summaryrefslogtreecommitdiff
path: root/t/test-custodian-testfactory.rb
diff options
context:
space:
mode:
authorSteve Kemp <steve@steve.org.uk>2012-11-23 15:54:53 +0000
committerSteve Kemp <steve@steve.org.uk>2012-11-23 15:54:53 +0000
commit3cf93c18f70758453899fa8bfa71591fcb6e83f5 (patch)
tree7422c1edbfe6ba38675e66d88a1f98cee920923f /t/test-custodian-testfactory.rb
parentb42677d69de3dab1a55c81689cf2b3b45fd85d12 (diff)
Allow the test-factory to return the known-test types, and then test *each* of the with a simple constructed test.
Diffstat (limited to 't/test-custodian-testfactory.rb')
-rwxr-xr-xt/test-custodian-testfactory.rb28
1 files changed, 28 insertions, 0 deletions
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