From 21659bf0caab820d3c90efe3785c7521974272a8 Mon Sep 17 00:00:00 2001 From: Steve Kemp Date: Fri, 23 Nov 2012 15:54:53 +0000 Subject: Allow the test-factory to return the known-test types, and then test *each* of the with a simple constructed test. --- t/test-custodian-testfactory.rb | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) (limited to 't') diff --git a/t/test-custodian-testfactory.rb b/t/test-custodian-testfactory.rb index db79f50..b7834ea 100755 --- a/t/test-custodian-testfactory.rb +++ b/t/test-custodian-testfactory.rb @@ -168,5 +168,33 @@ class TestTestFactory < Test::Unit::TestCase end end + + # + # Get all the types we know about. + # + def test_types + registered = Custodian::TestFactory.known_tests() + + registered.each do |obj| + + # + # Try to get the name + # + name=obj.to_s + if ( name =~ /protocoltest::(.*)Test$/i ) + tst = $1.dup.downcase + + # normal + test_one = "http://foo/ must run #{tst} on 1234" + test_two = "http://foo/ must not run #{tst} on 12345" + + assert_nothing_raised do + assert( Custodian::TestFactory.create( test_one ) ) + assert( Custodian::TestFactory.create( test_two ) ) + end + end + end + end + end -- cgit v1.2.1