diff options
author | Steve Kemp <steve@steve.org.uk> | 2012-11-24 20:07:38 +0000 |
---|---|---|
committer | Steve Kemp <steve@steve.org.uk> | 2012-11-24 20:07:38 +0000 |
commit | 78d28d532d91c2bc5f0c42ea3a9f2c8a0813a34c (patch) | |
tree | 1e0f4ce060f986ba88bb1cf073fd4c0d7c827a45 | |
parent | 7b22a2bd29be916cdd4a054962c985f5e6100a39 (diff) |
Test that each test-type returns the correct host.
-rwxr-xr-x | t/test-custodian-testfactory.rb | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/t/test-custodian-testfactory.rb b/t/test-custodian-testfactory.rb index a14fce9..8ba315e 100755 --- a/t/test-custodian-testfactory.rb +++ b/t/test-custodian-testfactory.rb @@ -254,5 +254,31 @@ class TestTestFactory < Test::Unit::TestCase end end + + # + # Test the target of each test is always what we expect. + # + def test_target_detection + + + a = Array.new() + + a.push( "test.host.example.com must run ftp.") + a.push( "ftp://test.host.example.com/ must run ftp.") + a.push( "ftp://test.host.example.com/foo must run ftp.") + a.push( "test.host.example.com must run ping.") + a.push( "test.host.example.com must run dns for bytemark.co.uk resolving NS as '80.68.80.26;85.17.170.78;80.68.80.27'.") + a.push( "rsync://test.host.example.com must run rsync.") + a.push( "rsync://test.host.example.com must run rsync.") + + a.each do |entry| + assert_nothing_raised do + obj = Custodian::TestFactory.create( entry ) + assert(obj) + assert_equal( "test.host.example.com", obj.target() ) + end + end + end + end |