summaryrefslogtreecommitdiff
path: root/t
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
commitde60130c80c1de1db576299cfbc5a13eedc7dccc (patch)
treed14f1e6afa263a960f903a258d0316c50c9509e8 /t
parent21d22993c5a922d733d1a948afb8cd486f984c8a (diff)
Added test-case for HTTP protocol matching against URI scheme
Diffstat (limited to 't')
-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