class TC_Enviro < Test::Unit::TestCase include P4RubyTest def name "Test client environment" end def test_enviro assert( p4, "Failed to create Perforce client" ) p4.user = "tony" p4.client = "myworkstation" p4.port = "myserver:1666" p4.password = "mypass" assert_equal( p4.user, "tony" ) assert_equal( p4.client, "myworkstation" ) assert_equal( p4.port, "myserver:1666" ) assert_equal( p4.password, "mypass" ) end end
Rework P4Ruby unit tests so they they are actually units. Now the
test order is irrelevant as all tests are standalone. Tidied up
the code formatting as well and removed all the tabs from the ruby
sources files. Added a modeline for vim users so consistent
indentation will be used.
Make P4Ruby build with Ruby 2.0.0 (on Mac at least). Mostly
cosmetic changes: just makes the build script handle the
Ruby 2 mkmf and the changes also work with 1.8.7 and 1.9.3
so they should probably have been like this all along.
Infrastructure change only - no functional change
|#8||14637||jmistry||Remove P4IGNORE and P4CLIENTPATH tests|
|#7||14620||jmistry||Add P4IGNORE and P4CLIENTPATH unit tests|
Fix P4#set_env unit test
Unit test incorrectly checked if the platform is Linux and skipped
part of the test if it was. So, this part of the test was still
running on platforms that do not support P4#set_env and would raise
an (expected) exception during the unit test.
Now it checks if the platform is Windows or Darwin, and if it is
it runs the registry setting test.
Support setting values in the registry through P4Ruby.
The command P4.set_env( var, val ) will set a registry variably on platforms
that support this action or through an exception on Unix.
The command P4.set_env( var ) resets a registry variable.
Updated unit test '02_environment.rb' to include registry set/check.
User visible change to be documented in release notes.
Fix unlink error on unit tests
Wrap the connect/disconnect in begin/ensure blocks to
ensure that the client disconnect even if there are failures
in a unit test.
Fix unicode unit test for 1.9. When the contents of a file
is stored in a String object, ruby 1.9 sets the String's
encoding to the current locale. This is overridden in the
test case and set to the correct value. This may need to
user visible change.
|#3||14522||tony||Add copyright notices to the test files.|
Add P4#version= and P4#version methods to get/set the version of
User-visible change to be documented in Scripting Interface Guide
Shuffle up the tests to make some room for one that tests setting
and getting of client environment vars.
Also give nice names to the tests while we're there.