webmock 3.4.0 → 3.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +6 -0
- data/README.md +1 -0
- data/lib/webmock/util/values_stringifier.rb +3 -3
- data/lib/webmock/version.rb +1 -1
- data/spec/acceptance/shared/stubbing_requests.rb +8 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: '086af9d48e21a095a9447cee1e20b2630a9fcbe299a5212a9f13e8daa5209f71'
|
4
|
+
data.tar.gz: 7afbd414ac88a4da8180934c81adea158230a8bac7eaa0c24f7cefceab056101
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 995f6f1be116147e3b832a0070b6cf780bfcaf45b2aae80c0a61f990c20c199955418cc809ba6489cbce7cef0c568571e811bb93a42633e0fb512f48c3b003c5
|
7
|
+
data.tar.gz: 5d2f3395dedcc227e1e492e5e7d6938cb9224e0084a09b6d157e204cc7205835c87816cb62068cbcbbf6290a0fb4f4a5f41465345da0fd30e065f74b3d36b8e0
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,11 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
+
## 3.4.1
|
4
|
+
|
5
|
+
* When comparing url encoded body to a body from request stub, which was declared as hash, only String, Numeric and boolean hash values are stringified before the comparison.
|
6
|
+
|
7
|
+
Thanks to [Lukas Pokorny](https://github.com/luk4s)
|
8
|
+
|
3
9
|
## 3.4.0
|
4
10
|
|
5
11
|
* Ruby 2.6 support. Prevent `Net/ReadTimeout` error in Ruby 2.6
|
data/README.md
CHANGED
@@ -1055,6 +1055,7 @@ People who submitted patches and new features or suggested improvements. Many th
|
|
1055
1055
|
* Matt Brictson
|
1056
1056
|
* Kenny Ortmann
|
1057
1057
|
* redbar0n
|
1058
|
+
* Lukas Pokorny
|
1058
1059
|
|
1059
1060
|
For a full list of contributors you can visit the
|
1060
1061
|
[contributors](https://github.com/bblimke/webmock/contributors) page.
|
@@ -1,8 +1,8 @@
|
|
1
1
|
class WebMock::Util::ValuesStringifier
|
2
2
|
def self.stringify_values(value)
|
3
3
|
case value
|
4
|
-
when
|
5
|
-
value
|
4
|
+
when String, Numeric, TrueClass, FalseClass
|
5
|
+
value.to_s
|
6
6
|
when Hash
|
7
7
|
Hash[
|
8
8
|
value.map do |k, v|
|
@@ -14,7 +14,7 @@ class WebMock::Util::ValuesStringifier
|
|
14
14
|
stringify_values(v)
|
15
15
|
end
|
16
16
|
else
|
17
|
-
value
|
17
|
+
value
|
18
18
|
end
|
19
19
|
end
|
20
20
|
end
|
data/lib/webmock/version.rb
CHANGED
@@ -172,6 +172,14 @@ shared_examples_for "stubbing requests" do |*adapter_info|
|
|
172
172
|
:post, "http://www.example.com/", headers: {'Content-Type' => 'application/x-www-form-urlencoded'},
|
173
173
|
body: "foo=1").status).to eq("200")
|
174
174
|
end
|
175
|
+
|
176
|
+
it "should match if stubbed request body is hash_included" do
|
177
|
+
WebMock.reset!
|
178
|
+
stub_request(:post, "www.example.com").with(body: {"foo" => hash_including("bar" => '1')})
|
179
|
+
expect(http_request(
|
180
|
+
:post, "http://www.example.com/", headers: {'Content-Type' => 'application/x-www-form-urlencoded'},
|
181
|
+
body: "foo[bar]=1").status).to eq("200")
|
182
|
+
end
|
175
183
|
end
|
176
184
|
end
|
177
185
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: webmock
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.4.
|
4
|
+
version: 3.4.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Bartosz Blimke
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-05-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: addressable
|