class TC_Client < Test::Unit::TestCase include P4RubyTest def test_client_creation assert( p4.connect, "Failed to connect to Perforce server" ) client = p4.fetch_client assert( client.kind_of?( P4::Spec ), "Client wasn't a P4::Spec object" ) client._root = client_root() client._description = "Test client\n" assert_block( "Failed to save Perforce client" ) do begin p4.save_client( client ) true rescue P4Exception false end end client2 = p4.fetch_client assert( client2.kind_of?( P4::Spec ), "Client2 wasn't a P4::Spec object" ) assert_equal( client._root, client2._root, "Client roots differ" ) assert_equal( client._description, client2._description, "Client descriptions differ" ) end end
# | Change | User | Description | Committed | |
---|---|---|---|---|---|
#2 | 14499 | tony |
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. |
||
#1 | 14491 | tony |
Add first draft of automated test suite for P4Ruby. Run it using 'ruby test.rb' |