webmock 1.2.1 → 1.2.2
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG.md +4 -0
- data/README.md +1 -0
- data/VERSION +1 -1
- data/lib/webmock/util/uri.rb +5 -1
- data/spec/util/uri_spec.rb +5 -0
- data/webmock.gemspec +2 -2
- metadata +3 -3
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.2.
|
1
|
+
1.2.2
|
data/lib/webmock/util/uri.rb
CHANGED
@@ -16,7 +16,7 @@ module WebMock
|
|
16
16
|
return uri if uri.is_a?(Regexp)
|
17
17
|
uri = 'http://' + uri unless uri.match('^https?://') if uri.is_a?(String)
|
18
18
|
normalized_uri = Addressable::URI.heuristic_parse(uri)
|
19
|
-
normalized_uri.query_values =
|
19
|
+
normalized_uri.query_values = sort_query_values(normalized_uri.query_values) if normalized_uri.query_values
|
20
20
|
normalized_uri = normalized_uri.normalize #normalize! is slower
|
21
21
|
normalized_uri.port = normalized_uri.inferred_port unless normalized_uri.port
|
22
22
|
normalized_uri
|
@@ -57,6 +57,10 @@ module WebMock
|
|
57
57
|
|
58
58
|
private
|
59
59
|
|
60
|
+
def self.sort_query_values(query_values)
|
61
|
+
Hash[*query_values.sort.inject([]) { |values, pair| values + pair}]
|
62
|
+
end
|
63
|
+
|
60
64
|
def self.uris_with_inferred_port_and_without(uris)
|
61
65
|
uris.map { |uri| [ uri, uri.gsub(%r{(:80)|(:443)}, "").freeze ] }.flatten
|
62
66
|
end
|
data/spec/util/uri_spec.rb
CHANGED
@@ -167,6 +167,11 @@ describe WebMock::Util::URI do
|
|
167
167
|
end
|
168
168
|
end
|
169
169
|
|
170
|
+
it "should successfully handle array parameters" do
|
171
|
+
uri = 'http://www.example.com:80/path?a[]=b&a[]=c'
|
172
|
+
lambda { WebMock::Util::URI.normalize_uri(uri) }.should_not raise_error(ArgumentError)
|
173
|
+
end
|
174
|
+
|
170
175
|
end
|
171
176
|
|
172
177
|
describe "stripping default port" do
|
data/webmock.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{webmock}
|
8
|
-
s.version = "1.2.
|
8
|
+
s.version = "1.2.2"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Bartosz Blimke"]
|
12
|
-
s.date = %q{2010-05-
|
12
|
+
s.date = %q{2010-05-26}
|
13
13
|
s.description = %q{WebMock allows stubbing HTTP requests and setting expectations on HTTP requests.}
|
14
14
|
s.email = %q{bartosz.blimke@gmail.com}
|
15
15
|
s.extra_rdoc_files = [
|
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 1
|
7
7
|
- 2
|
8
|
-
-
|
9
|
-
version: 1.2.
|
8
|
+
- 2
|
9
|
+
version: 1.2.2
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- Bartosz Blimke
|
@@ -14,7 +14,7 @@ autorequire:
|
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
16
|
|
17
|
-
date: 2010-05-
|
17
|
+
date: 2010-05-26 00:00:00 +01:00
|
18
18
|
default_executable:
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|