From 4c4829747aa5ac151c6484e9192cd81da5ed7b8b Mon Sep 17 00:00:00 2001 From: Steve Kemp Date: Fri, 23 Nov 2012 21:18:04 +0000 Subject: Basic testing of the DNS-protocol tester. --- 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 0f4777a..2e4f5b9 100755 --- a/t/test-custodian-testfactory.rb +++ b/t/test-custodian-testfactory.rb @@ -126,6 +126,28 @@ class TestTestFactory < Test::Unit::TestCase + + # + # Test the DNS test may be created + # + def test_dns_handler + + assert_nothing_raised do + assert( Custodian::TestFactory.create( "a.ns.bytemark.co.uk must run dns for bytemark.co.uk resolving NS as '80.68.80.26;85.17.170.78;80.68.80.27'." ) ) + end + + # + # Missing record-type + # + assert_raise ArgumentError do + Custodian::TestFactory.create( "a.ns.bytemark.co.uk must run dns for bytemark.co.uk as '80.68.80.26;85.17.170.78;80.68.80.27'." ) + end + + end + + + + # # Test the creation of inverted tests. # @@ -177,6 +199,7 @@ class TestTestFactory < Test::Unit::TestCase registered.each do |obj| + # # Try to get the name # @@ -184,6 +207,11 @@ class TestTestFactory < Test::Unit::TestCase if ( name =~ /protocoltest::(.*)Test$/i ) tst = $1.dup.downcase + # + # NOTE: Skip the DNS test - it is more complex. + # + next if ( tst =~ /dns/ ) + # normal test_one = "http://foo/ must run #{tst} on 1234" test_two = "http://foo/ must not run #{tst} on 12345" -- cgit v1.2.1