From 932f5cb16f6be3178a551ff2c6ebc70843722a00 Mon Sep 17 00:00:00 2001 From: Steve Kemp Date: Thu, 20 Dec 2012 19:05:32 +0000 Subject: Added test-case for HTTP protocol matching against URI scheme --- t/test-http-vs-https.rb | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) 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 -- cgit v1.2.1