summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/custodian/protocoltest/http.rb14
-rwxr-xr-xt/test-custodian-parser.rb8
2 files changed, 8 insertions, 14 deletions
diff --git a/lib/custodian/protocoltest/http.rb b/lib/custodian/protocoltest/http.rb
index 34e4b6e..a4c4adb 100644
--- a/lib/custodian/protocoltest/http.rb
+++ b/lib/custodian/protocoltest/http.rb
@@ -102,18 +102,12 @@ module Custodian
raise ArgumentError, "The test case has a different protocol in the URI than that which we're testing: #{@line} - \"#{test_type} != #{u.scheme}\""
end
-
#
- # Look for username & password
+ # Save username/password if they were specified
#
- if line =~ /with auth '([^']+)'/
- data = $1.dup
- @username, @password = data.split( ":" )
- end
- if line =~ /with auth "([^"]+)"/
- data = $1.dup
- @username, @password = data.split( ":" )
- end
+ @username = u.user if ( u.user )
+ @password = u.password if ( u.password )
+
#
# Expected status
diff --git a/t/test-custodian-parser.rb b/t/test-custodian-parser.rb
index 843dc80..2239503 100755
--- a/t/test-custodian-parser.rb
+++ b/t/test-custodian-parser.rb
@@ -438,12 +438,12 @@ EOF
# test data
#
data = {
- 'http://example must run http with auth "bob:steve".' =>
+ 'http://bob:steve@example must run http.' =>
{ username: 'bob', password: 'steve'},
- 'http://example must run http with auth "stee\':steve".' =>
+ 'http://stee\':steve@example must run http.' =>
{ username: 'stee\'', password: 'steve'},
- 'http://example must run http with auth \'e"e:pa$$w0rd\'.' =>
- { username: 'e"e', password: 'pa$$w0rd'},
+ 'http://e\'e:pa$$w0rd@example must run http.' =>
+ { username: 'e\'e', password: 'pa$$w0rd'},
}
data.each do |str, hash |