webmock 3.4.0 → 3.4.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: babd32444fb5057e9e1945acefbef6601b5b9e2c78a3670ff929a027b89529eb
4
- data.tar.gz: 3016884b0119a6cf8e2685628744f661b7d0e0b59462b925b98598732d5cd1a7
3
+ metadata.gz: '086af9d48e21a095a9447cee1e20b2630a9fcbe299a5212a9f13e8daa5209f71'
4
+ data.tar.gz: 7afbd414ac88a4da8180934c81adea158230a8bac7eaa0c24f7cefceab056101
5
5
  SHA512:
6
- metadata.gz: 15e986cdda0dc84d50d35e0e596e92ae18edac6d19c3dcf16930256fc518ddeecab5a5d7e0f5c404bf285f877627707872992547a35f4e4dee2fb31dc4af19f0
7
- data.tar.gz: 3ac9e572b8785c1059c1c1388822854a7600cfc28017e48f6dbe2ee3934c29bab214f54b29cd73ee605e74abcac35a0d2dc7cb132bdc54bbfe6853f547626c55
6
+ metadata.gz: 995f6f1be116147e3b832a0070b6cf780bfcaf45b2aae80c0a61f990c20c199955418cc809ba6489cbce7cef0c568571e811bb93a42633e0fb512f48c3b003c5
7
+ data.tar.gz: 5d2f3395dedcc227e1e492e5e7d6938cb9224e0084a09b6d157e204cc7205835c87816cb62068cbcbbf6290a0fb4f4a5f41465345da0fd30e065f74b3d36b8e0
@@ -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 nil
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.to_s
17
+ value
18
18
  end
19
19
  end
20
20
  end
@@ -1,3 +1,3 @@
1
1
  module WebMock
2
- VERSION = '3.4.0' unless defined?(::WebMock::VERSION)
2
+ VERSION = '3.4.1' unless defined?(::WebMock::VERSION)
3
3
  end
@@ -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.0
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-04-30 00:00:00.000000000 Z
11
+ date: 2018-05-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: addressable