summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorSteve Kemp <steve@steve.org.uk>2015-02-18 11:15:20 +0000
committerSteve Kemp <steve@steve.org.uk>2015-02-18 11:15:20 +0000
commit07de904e02d7245e4f8aa657543aaec7294ba5b9 (patch)
treecfbf8d9e3f23102c623e4193a41bd4dbd0317de1 /t
parent32c83aa4c8943e116311fda2dd0da65acce049d9 (diff)
Updated to load the test-implementations more carefully.
This fully explores the parsing and unparsing of the test-objects, with the exceptions of DNS, FTP, LDAP, and SSLCertificates.
Diffstat (limited to 't')
-rwxr-xr-xt/test-custodian-testfactory.rb43
1 files changed, 21 insertions, 22 deletions
diff --git a/t/test-custodian-testfactory.rb b/t/test-custodian-testfactory.rb
index 81d18a5..aef71c6 100755
--- a/t/test-custodian-testfactory.rb
+++ b/t/test-custodian-testfactory.rb
@@ -249,35 +249,35 @@ class TestTestFactory < Test::Unit::TestCase
def test_types
registered = Custodian::TestFactory.known_tests()
- registered.each do |obj|
+ # for each test-type
+ registered.keys.each do |type|
+ # for each handler ..
+ registered[type].each do |name|
- #
- # Try to get the name
- #
- name=obj.to_s
- if ( name =~ /protocoltest::(.*)Test$/i )
- tst = $1.dup.downcase
+ if ( name.to_s =~ /protocoltest::(.*)Test$/i )
+ tst = $1.dup.downcase
- #
- # NOTE: Skip the DNS and LDAP tests - they are more complex.
- #
- next if ( tst =~ /^(ldap|dns|dnsbl)$/ )
+ #
+ # NOTE: Skip the DNS and LDAP tests - they are more complex.
+ #
+ next if ( tst =~ /^(ldap|dns|dnsbl|sslcertificate)$/ )
- # normal
- test_one = "http://foo/ must run #{tst} on 1234"
- test_two = "http://foo/ must not run #{tst} on 12345"
+ # normal
+ test_one = "http://foo.com/.com must run #{tst} on 1234"
+ test_two = "http://foo.com/ must not run #{tst} on 12345"
- assert_nothing_raised do
+ assert_nothing_raised do
- test_one_obj = Custodian::TestFactory.create( test_one )
- assert( !test_one_obj.inverted() )
+ test_one_obj = Custodian::TestFactory.create( test_one )
+ assert( !test_one_obj[0].inverted() )
- test_two_obj = Custodian::TestFactory.create( test_two )
- assert( test_two_obj.inverted(), "Found inverted test for #{tst}" )
+ test_two_obj = Custodian::TestFactory.create( test_two )
+ assert( test_two_obj[0].inverted(), "Found inverted test for #{tst}" )
- assert_equal( tst, test_one_obj.get_type )
- assert_equal( tst, test_two_obj.get_type )
+ assert_equal( tst, test_one_obj[0].get_type )
+ assert_equal( tst, test_two_obj[0].get_type )
+ end
end
end
end
@@ -312,4 +312,3 @@ class TestTestFactory < Test::Unit::TestCase
end
end
-