From ae6d7535e825807a559877c3fc301a17f031d9d3 Mon Sep 17 00:00:00 2001 From: Steve Kemp Date: Wed, 18 Feb 2015 11:15:20 +0000 Subject: 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. --- t/test-custodian-testfactory.rb | 43 ++++++++++++++++++++--------------------- 1 file 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 - -- cgit v1.2.1