summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSteve Kemp <steve@steve.org.uk>2012-12-20 19:05:32 +0000
committerSteve Kemp <steve@steve.org.uk>2012-12-20 19:05:32 +0000
commit932f5cb16f6be3178a551ff2c6ebc70843722a00 (patch)
treed20ab41bb2e6a6ce248a1377e54ef2c9f8a6c3cf
parent6c6762cc4e99184f8b0903c8db88f81a021479c5 (diff)
Added test-case for HTTP protocol matching against URI scheme
-rwxr-xr-xt/test-http-vs-https.rb25
1 files changed, 25 insertions, 0 deletions
diff --git a/t/test-http-vs-https.rb b/t/test-http-vs-https.rb
index ada49d6..8ad5aea 100755
--- a/t/test-http-vs-https.rb
+++ b/t/test-http-vs-https.rb
@@ -64,5 +64,30 @@ class TestTestName < Test::Unit::TestCase
assert_equal( test.get_type, "https" )
end
+
+ #
+ # It is a bug to have the protocol-test differ from the URI's protocol.
+ #
+ def test_protocol_mismatch
+
+
+ assert_raise ArgumentError do
+ Custodian::TestFactory.create( "https://example.com/ must run http." )
+ end
+
+ assert_raise ArgumentError do
+ Custodian::TestFactory.create( "http://example.com/ must run https." )
+ end
+
+
+ assert_nothing_raised do
+ Custodian::TestFactory.create( "http://example.com/ must run http." )
+ end
+ assert_nothing_raised do
+ Custodian::TestFactory.create( "https://example.com/ must run https." )
+ end
+
+ end
+
end