summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorSteve Kemp <steve@steve.org.uk>2015-03-10 09:20:49 +0000
committerSteve Kemp <steve@steve.org.uk>2015-03-10 09:20:49 +0000
commit2e86852d3bc31de6197a54d6e91bba4e46f4368a (patch)
tree98dbd2314655b3c4bcb81d90e02c95038b27ac36 /t
parent9cc9e6f70e82bf4cab8a5909412df90b4ac71179 (diff)
Removed this test-case.
The method-stubbing doesn't work, and so it is obsolete.
Diffstat (limited to 't')
-rwxr-xr-xt/test-dns-types.rb83
1 files changed, 0 insertions, 83 deletions
diff --git a/t/test-dns-types.rb b/t/test-dns-types.rb
deleted file mode 100755
index e8da275..0000000
--- a/t/test-dns-types.rb
+++ /dev/null
@@ -1,83 +0,0 @@
-#!/usr/bin/ruby -Ilib/ -I../lib/
-
-
-require 'test/unit'
-require 'rubygems'
-#require 'mocha/setup'
-require 'mocha'
-require 'custodian/protocoltests'
-
-
-
-#
-# The DNS test is a complex one.
-#
-class TestDNSTypes < Test::Unit::TestCase
-
- #
- # Create the test suite environment: NOP.
- #
- def setup
- end
-
- #
- # Destroy the test suite environment: NOP.
- #
- def teardown
- end
-
-
- #
- # Test the known-record types: A, NS, MX, AAAA
- #
- def test_known_types
-
- assert_nothing_raised do
- test = Custodian::TestFactory.create( "a.ns.bytemark.co.uk must run dns for bytemark.co.uk resolving NS as 'foo'." )
- test = Custodian::TestFactory.create( "a.ns.bytemark.co.uk must run dns for bytemark.co.uk resolving A as 'foo'." )
- test = Custodian::TestFactory.create( "a.ns.bytemark.co.uk must run dns for bytemark.co.uk resolving MX as 'foo'." )
- test = Custodian::TestFactory.create( "a.ns.bytemark.co.uk must run dns for bytemark.co.uk resolving AAAA as 'foo'." )
- end
-
- end
-
-
-
- #
- # Test that using random types fails.
- #
- def test_unknown_types
-
- #
- # Each of these will fail
- #
- %w( a ns www example fdskfjdlfsj `` ).each do |res|
- assert_raise ArgumentError do
- Custodian::TestFactory.create( "a.ns.bytemark.co.uk must run dns for bytemark.co.uk resolving #{res} as 'foo'." )
- end
- end
- end
-
- #
- # Now test the protocol stuff, without doing the resolution itself.
- #
- def test_dns_protocol_test
- test = Custodian::TestFactory.create( "a.ns.bytemark.co.uk must run dns for bytemark.co.uk resolving A as '1.2.3.4,2001:lower::case,2001:UPPER::CASE'." )
- test.stubs(:resolve_via).returns(%w(2001:lower::case 2001:upper::case 1.2.3.4))
- assert test.run_test, "The error was #{test.error}"
-
- # Re-stub to return just one record
- test.stubs(:resolve_via).returns(%w(1.2.3.4))
- assert !test.run_test
-
- # Re-stub to return too many records
- test.stubs(:resolve_via).returns(%w(2001:lower::case 2001:upper::case 1.2.3.4 1.2.3.5))
- assert !test.run_test
-
- # Re-stub to return no records
- test.stubs(:resolve_via).returns([])
- assert !test.run_test
- end
-
-end
-