webmock 3.0.1 → 3.20.0

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.
Files changed (138) hide show
  1. checksums.yaml +5 -5
  2. data/CHANGELOG.md +558 -2
  3. data/README.md +200 -42
  4. data/lib/webmock/api.rb +14 -0
  5. data/lib/webmock/assertion_failure.rb +2 -0
  6. data/lib/webmock/callback_registry.rb +2 -0
  7. data/lib/webmock/config.rb +2 -0
  8. data/lib/webmock/cucumber.rb +2 -0
  9. data/lib/webmock/deprecation.rb +2 -0
  10. data/lib/webmock/errors.rb +2 -0
  11. data/lib/webmock/http_lib_adapters/async_http_client_adapter.rb +223 -0
  12. data/lib/webmock/http_lib_adapters/curb_adapter.rb +21 -5
  13. data/lib/webmock/http_lib_adapters/em_http_request_adapter.rb +20 -9
  14. data/lib/webmock/http_lib_adapters/excon_adapter.rb +7 -2
  15. data/lib/webmock/http_lib_adapters/http_lib_adapter.rb +2 -0
  16. data/lib/webmock/http_lib_adapters/http_lib_adapter_registry.rb +2 -0
  17. data/lib/webmock/http_lib_adapters/http_rb/client.rb +4 -1
  18. data/lib/webmock/http_lib_adapters/http_rb/request.rb +19 -1
  19. data/lib/webmock/http_lib_adapters/http_rb/response.rb +29 -3
  20. data/lib/webmock/http_lib_adapters/http_rb/streamer.rb +11 -3
  21. data/lib/webmock/http_lib_adapters/http_rb/webmock.rb +9 -3
  22. data/lib/webmock/http_lib_adapters/http_rb_adapter.rb +2 -0
  23. data/lib/webmock/http_lib_adapters/httpclient_adapter.rb +30 -9
  24. data/lib/webmock/http_lib_adapters/manticore_adapter.rb +35 -15
  25. data/lib/webmock/http_lib_adapters/net_http.rb +38 -89
  26. data/lib/webmock/http_lib_adapters/net_http_response.rb +3 -1
  27. data/lib/webmock/http_lib_adapters/patron_adapter.rb +6 -4
  28. data/lib/webmock/http_lib_adapters/typhoeus_hydra_adapter.rb +18 -2
  29. data/lib/webmock/matchers/any_arg_matcher.rb +15 -0
  30. data/lib/webmock/matchers/hash_argument_matcher.rb +23 -0
  31. data/lib/webmock/matchers/hash_excluding_matcher.rb +17 -0
  32. data/lib/webmock/matchers/hash_including_matcher.rb +6 -23
  33. data/lib/webmock/minitest.rb +2 -0
  34. data/lib/webmock/rack_response.rb +3 -1
  35. data/lib/webmock/request_body_diff.rb +3 -1
  36. data/lib/webmock/request_execution_verifier.rb +4 -3
  37. data/lib/webmock/request_pattern.rb +132 -52
  38. data/lib/webmock/request_registry.rb +3 -1
  39. data/lib/webmock/request_signature.rb +5 -3
  40. data/lib/webmock/request_signature_snippet.rb +6 -4
  41. data/lib/webmock/request_stub.rb +34 -0
  42. data/lib/webmock/response.rb +22 -14
  43. data/lib/webmock/responses_sequence.rb +2 -0
  44. data/lib/webmock/rspec/matchers/request_pattern_matcher.rb +2 -0
  45. data/lib/webmock/rspec/matchers/webmock_matcher.rb +2 -0
  46. data/lib/webmock/rspec/matchers.rb +2 -0
  47. data/lib/webmock/rspec.rb +12 -3
  48. data/lib/webmock/stub_registry.rb +28 -11
  49. data/lib/webmock/stub_request_snippet.rb +12 -6
  50. data/lib/webmock/test_unit.rb +3 -3
  51. data/lib/webmock/util/hash_counter.rb +15 -9
  52. data/lib/webmock/util/hash_keys_stringifier.rb +2 -0
  53. data/lib/webmock/util/hash_validator.rb +2 -0
  54. data/lib/webmock/util/headers.rb +39 -11
  55. data/lib/webmock/util/json.rb +3 -2
  56. data/lib/webmock/util/query_mapper.rb +11 -7
  57. data/lib/webmock/util/uri.rb +13 -11
  58. data/lib/webmock/util/values_stringifier.rb +22 -0
  59. data/lib/webmock/util/version_checker.rb +7 -5
  60. data/lib/webmock/version.rb +3 -1
  61. data/lib/webmock/webmock.rb +22 -3
  62. data/lib/webmock.rb +55 -48
  63. metadata +106 -175
  64. data/.gemtest +0 -0
  65. data/.gitignore +0 -34
  66. data/.rspec-tm +0 -2
  67. data/.travis.yml +0 -20
  68. data/Gemfile +0 -9
  69. data/Rakefile +0 -30
  70. data/minitest/test_helper.rb +0 -34
  71. data/minitest/test_webmock.rb +0 -9
  72. data/minitest/webmock_spec.rb +0 -60
  73. data/spec/acceptance/curb/curb_spec.rb +0 -466
  74. data/spec/acceptance/curb/curb_spec_helper.rb +0 -147
  75. data/spec/acceptance/em_http_request/em_http_request_spec.rb +0 -406
  76. data/spec/acceptance/em_http_request/em_http_request_spec_helper.rb +0 -77
  77. data/spec/acceptance/excon/excon_spec.rb +0 -75
  78. data/spec/acceptance/excon/excon_spec_helper.rb +0 -50
  79. data/spec/acceptance/http_rb/http_rb_spec.rb +0 -73
  80. data/spec/acceptance/http_rb/http_rb_spec_helper.rb +0 -51
  81. data/spec/acceptance/httpclient/httpclient_spec.rb +0 -210
  82. data/spec/acceptance/httpclient/httpclient_spec_helper.rb +0 -57
  83. data/spec/acceptance/manticore/manticore_spec.rb +0 -56
  84. data/spec/acceptance/manticore/manticore_spec_helper.rb +0 -35
  85. data/spec/acceptance/net_http/net_http_shared.rb +0 -153
  86. data/spec/acceptance/net_http/net_http_spec.rb +0 -317
  87. data/spec/acceptance/net_http/net_http_spec_helper.rb +0 -64
  88. data/spec/acceptance/net_http/real_net_http_spec.rb +0 -20
  89. data/spec/acceptance/patron/patron_spec.rb +0 -118
  90. data/spec/acceptance/patron/patron_spec_helper.rb +0 -54
  91. data/spec/acceptance/shared/allowing_and_disabling_net_connect.rb +0 -313
  92. data/spec/acceptance/shared/callbacks.rb +0 -147
  93. data/spec/acceptance/shared/complex_cross_concern_behaviors.rb +0 -36
  94. data/spec/acceptance/shared/enabling_and_disabling_webmock.rb +0 -95
  95. data/spec/acceptance/shared/precedence_of_stubs.rb +0 -15
  96. data/spec/acceptance/shared/request_expectations.rb +0 -916
  97. data/spec/acceptance/shared/returning_declared_responses.rb +0 -388
  98. data/spec/acceptance/shared/stubbing_requests.rb +0 -583
  99. data/spec/acceptance/typhoeus/typhoeus_hydra_spec.rb +0 -135
  100. data/spec/acceptance/typhoeus/typhoeus_hydra_spec_helper.rb +0 -60
  101. data/spec/acceptance/webmock_shared.rb +0 -41
  102. data/spec/fixtures/test.txt +0 -1
  103. data/spec/quality_spec.rb +0 -84
  104. data/spec/spec_helper.rb +0 -48
  105. data/spec/support/example_curl_output.txt +0 -22
  106. data/spec/support/failures.rb +0 -9
  107. data/spec/support/my_rack_app.rb +0 -53
  108. data/spec/support/network_connection.rb +0 -19
  109. data/spec/support/webmock_server.rb +0 -69
  110. data/spec/unit/api_spec.rb +0 -75
  111. data/spec/unit/errors_spec.rb +0 -129
  112. data/spec/unit/http_lib_adapters/http_lib_adapter_registry_spec.rb +0 -17
  113. data/spec/unit/http_lib_adapters/http_lib_adapter_spec.rb +0 -12
  114. data/spec/unit/matchers/hash_including_matcher_spec.rb +0 -87
  115. data/spec/unit/rack_response_spec.rb +0 -112
  116. data/spec/unit/request_body_diff_spec.rb +0 -90
  117. data/spec/unit/request_execution_verifier_spec.rb +0 -208
  118. data/spec/unit/request_pattern_spec.rb +0 -590
  119. data/spec/unit/request_registry_spec.rb +0 -95
  120. data/spec/unit/request_signature_snippet_spec.rb +0 -89
  121. data/spec/unit/request_signature_spec.rb +0 -155
  122. data/spec/unit/request_stub_spec.rb +0 -199
  123. data/spec/unit/response_spec.rb +0 -282
  124. data/spec/unit/stub_registry_spec.rb +0 -103
  125. data/spec/unit/stub_request_snippet_spec.rb +0 -95
  126. data/spec/unit/util/hash_counter_spec.rb +0 -39
  127. data/spec/unit/util/hash_keys_stringifier_spec.rb +0 -27
  128. data/spec/unit/util/headers_spec.rb +0 -28
  129. data/spec/unit/util/json_spec.rb +0 -33
  130. data/spec/unit/util/query_mapper_spec.rb +0 -144
  131. data/spec/unit/util/uri_spec.rb +0 -299
  132. data/spec/unit/util/version_checker_spec.rb +0 -65
  133. data/spec/unit/webmock_spec.rb +0 -11
  134. data/test/http_request.rb +0 -24
  135. data/test/shared_test.rb +0 -95
  136. data/test/test_helper.rb +0 -23
  137. data/test/test_webmock.rb +0 -6
  138. data/webmock.gemspec +0 -46
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: b25e1f8ad8f3a8ffa79b1e54d0709069f9162b52
4
- data.tar.gz: 8169ef32ad67fecba074d929fb6d584410950617
2
+ SHA256:
3
+ metadata.gz: ffda5916fee8f80d1d0a725b7de314652a588658189bb28ad7a984551d406a3a
4
+ data.tar.gz: f2aa5c1f78094f72f9c7310dfbb3e866be2acc6910bd3c3a1a4e562744e0fa65
5
5
  SHA512:
6
- metadata.gz: 3daea98f13930398bd12722ff33b727c4c3b02ce41f2aeb3060d437d246ed5284c0737979bea0b7a46fa6dba6c24e90b1e4519d9b7f4e6d8d9e8d212869d9469
7
- data.tar.gz: 8f9fdee207513b9741f6245ed4b575120bd3232165edfa941a2f8113b11a2413f55945a5e5ce160cfb12da455545282b9e3f766903940fe7b878f49b5b59dbb9
6
+ metadata.gz: e3fbfb98e4a6d090abd630ccfea78f5b06038e3f6d4683bd1f651f6c8b07b31698f71f9588df1a8d90066ab0d38a088a604204b4f710bfd9249235a9f2664453
7
+ data.tar.gz: ffcaf10bc3cd523f6c12c2209fc4e48fb34813e520789ca78ee0cb65b3285f7bf1534ef36faafbd61a49d82ca547f2ecfb3ea74b33b5ba3b4294493f0683942d
data/CHANGELOG.md CHANGED
@@ -1,5 +1,561 @@
1
1
  # Changelog
2
2
 
3
+ # 3.20.0
4
+
5
+ * Optimised EmHttpRequestAdapter performance.
6
+
7
+ Thanks to [Ricardo Trindade](https://github.com/RicardoTrindade)
8
+
9
+ * Removed runtime dependency on base64.
10
+
11
+ Thanks to [Earlopain](https://github.com/Earlopain)
12
+
13
+ * Typhoeus::Response objects constructed from stubbed responses now have all timing attributes set to 0.0.
14
+
15
+ Thanks to [James Brown](https://github.com/Roguelazer)
16
+
17
+ * Optimised WebMock::Util::Headers by removing redundant freeze invocations.
18
+
19
+ Thanks to [Kazuhiro NISHIYAMA](https://github.com/znz)
20
+
21
+ * The default stubbed response body, which is an empty String, is unfrozen.
22
+
23
+ * When building signatures of requests made by http.rb, the request body encoding is now preserved.
24
+
25
+ # 3.19.1
26
+
27
+ * When passing a Proc or lambda as response body to `to_return_json`, the body is evaluated at the time of request and not at the time of `to_return_json` method invocation.
28
+
29
+ Thanks to [Jason Karns](https://github.com/jasonkarns) for reporting.
30
+
31
+ # 3.19.0
32
+
33
+ * Do not alter real (non-stubbed) request headers when handling em-http-request requests.
34
+
35
+ Thanks to [Yoann Lecuyer](https://github.com/ylecuyer)
36
+
37
+ * Fix matching stubs with HashExcludingMatcher
38
+
39
+ Thanks to [Lucas Arnaud](https://github.com/lucasarnaud)
40
+
41
+ * Remove development and test files from the gem package
42
+
43
+ Thanks to [Orien Madgwick](https://github.com/orien)
44
+
45
+ * Fix supported http client gem version checks.
46
+
47
+ Thanks to [Marc Rohloff](https://github.com/marcrohloff) and [Roman Stražanec](https://github.com/romanstrazanec)
48
+
49
+ * Non-string body passed to #to_return_json is now converted to JSON string.
50
+
51
+ Thanks to [inkstak](https://github.com/inkstak)
52
+
53
+ * `[::1]` is recognised as localhost e.g when passing `allow_localhost` option to `disable_net_connect!`
54
+
55
+ Thanks to [Yuki Inoue](https://github.com/Yuki-Inoue)
56
+
57
+ * Optimized `normalize_headers` for performance
58
+
59
+ Thanks to [Brandon Weaver](https://github.com/baweaver)
60
+
61
+ * Added Frozen string literal to files to optimise memory usage
62
+
63
+ Thanks to [Josh Nichols](https://github.com/technicalpickles)
64
+
65
+ # 3.18.1
66
+
67
+ * Reverted simplified connection handing in Net::HTTP adapter due to https://github.com/bblimke/webmock/issues/999
68
+
69
+ # 3.18.0
70
+
71
+ * Net::BufferedIO is not replaced anymore.
72
+
73
+ Thanks to [Ray Zane](https://github.com/rzane)
74
+
75
+ * Simplified connection handing in Net::HTTP adapter.
76
+
77
+ Thanks to [Ray Zane](https://github.com/rzane)
78
+
79
+ # 3.17.1
80
+
81
+ * Fixed Syntax Error
82
+
83
+ Thanks to [Mark Spangler](https://github.com/mspangler)
84
+
85
+ # 3.17.0
86
+
87
+ * Minimum required Ruby version is 2.3
88
+
89
+ Thanks to [Go Sueyoshi](https://github.com/sue445)
90
+
91
+ * When using Net::HTTP, stubbed socket StubSocket#close and StubSocket#closed? behave more like the real sockets.
92
+
93
+ Thanks to [Ray Zane](https://github.com/rzane)
94
+
95
+ * Added `peeraddr`, `ssl_version` and `cipher` methods to stubbed sockets used by Net::HTTP.
96
+
97
+ Thanks to [Ray Zane](https://github.com/rzane)
98
+
99
+ * Added support for matching top-level array in JSON request body.
100
+
101
+ E.g.
102
+
103
+ ````
104
+ stub_request(:post, 'www.example.com').with(body: [{a: 1}])
105
+ ````
106
+
107
+ Thanks to [Cedric Sohrauer](https://github.com/cedrics)
108
+
109
+ # 3.16.2
110
+
111
+ * Minimum required Ruby version is 2.0.
112
+
113
+ # 3.16.0 (yanked)
114
+
115
+ * Fix leaky file descriptors and reuse socket for persistent connections.
116
+
117
+ Thanks to [Ray Zane](https://github.com/rzane)
118
+
119
+ * Allow specifying for what URIs or hosts, Net::HTTP should connect on start.
120
+
121
+ Thanks to [Ray Zane](https://github.com/rzane)
122
+
123
+ # 3.15.2
124
+
125
+ * Minimum required Ruby version is 2.0.
126
+
127
+ # 3.15.0 (yanked)
128
+
129
+ * fixed async-http adapter on Windows
130
+
131
+ Thanks to [Pavel Rosický](https://github.com/ahorek)
132
+
133
+ * Support for http.rb >= 5.0.2
134
+
135
+ Thanks to [ojab](https://github.com/ojab)
136
+
137
+ * Curb adapter supports headers with `:` character in the header value
138
+
139
+ Thanks to [Giorgio Gambino](https://github.com/mrbuzz)
140
+
141
+ * Support for matching body of JSON or application/x-www-form-urlencoded requests with content type header including charset.
142
+
143
+ Thanks to [Timmitry](https://github.com/Timmitry)
144
+
145
+ * Prevent double-wrapping http.rb features on non-stubbed requests
146
+
147
+ Thanks to [Michael Fairley](https://github.com/michaelfairley)
148
+
149
+ # 3.14.0
150
+
151
+ * Bump Addressable from 2.3.6 to 2.8.0
152
+
153
+ Thanks to [Eduardo Hernandez](https://github.com/EduardoGHdez)
154
+
155
+ # 3.13.0
156
+
157
+ * Support http.rb 5.x
158
+
159
+ Thanks to [Will Storey](https://github.com/horgh)
160
+
161
+ # 3.12.2
162
+
163
+ * Fixed em-http-request adapter to avoid calling middleware twice.
164
+
165
+ Thanks to [Alex Vondrak](https://github.com/ajvondrak)
166
+
167
+ # 3.12.1
168
+
169
+ * Fixed handling of URIs with IPv6 addresses with square brackets when in Net::HTTP adapter.
170
+
171
+ Thanks to [Johanna Hartmann](https://github.com/JohannaHartmann)
172
+
173
+ # 3.12.0
174
+
175
+ * Added support for handling custom JSON and XML content types e.g. 'application/vnd.api+json'
176
+
177
+ # 3.11.3
178
+
179
+ * Fixed async-http adapter to only considered requests as real if they are real.
180
+
181
+ Thanks to Thanks to [Tony Schneider](https://github.com/tonywok) and [Samuel Williams](https://github.com/ioquatix)
182
+
183
+ # 3.11.2
184
+
185
+ * Fix for Manticore streaming mode
186
+
187
+ Thanks to [Oleksiy Kovyrin](https://github.com/kovyrin)
188
+
189
+ # 3.11.1
190
+
191
+ * Compatibility with async-http 0.54+
192
+
193
+ Thanks to [Jun Jiang](https://github.com/jasl)
194
+
195
+ # 3.11.0
196
+
197
+ * Added support for `features` in http.rb adapter.
198
+
199
+ Thanks to [Carl (ce07c3)](https://github.com/ce07c3)
200
+
201
+ # 3.10.0
202
+
203
+ * Added option to global stubs to have lower priority than local stubs.
204
+
205
+ WebMock.globally_stub_request(:after_local_stubs) do
206
+ { body: "global stub body" }
207
+ end
208
+
209
+ stub_request(:get, "www.example.com").to_return(body: 'non-global stub body')
210
+
211
+ expect(http_request(:get, "http://www.example.com/").body).to eq("non-global stub body")
212
+
213
+ Thanks to [Marek Kasztelnik](https://github.com/mkasztelnik)
214
+
215
+ # 3.9.5
216
+
217
+ * Prevent overwriting `teardown` method in Test::Unit
218
+
219
+ Thanks to [Jesse Bowes](https://github.com/jessebs)
220
+
221
+ # 3.9.4
222
+
223
+ * More intuitive error message when stubbed response body was provided as Hash
224
+
225
+ Thanks to [Ben Koshy](https://github.com/BKSpurgeon)
226
+
227
+ # 3.9.3
228
+
229
+ * Make httpclient_adapter thread-safe
230
+
231
+ Thanks to [Adam Harwood](https://github.com/adam-harwood)
232
+
233
+ # 3.9.2
234
+
235
+ * Made global stubs thread-safe
236
+
237
+ Thanks to [Adam Harwood](https://github.com/adam-harwood)
238
+
239
+ # 3.9.1
240
+
241
+ * Fixed support for passing `URI` objects as second argument of `stub_request`
242
+
243
+ Thanks to [Ryan Kerr](https://github.com/leboshi)
244
+
245
+ ## 3.9.0
246
+
247
+ * Allow using a "callable" (like a proc) as URI pattern
248
+
249
+ stub_request(:any, ->(uri) { true })
250
+
251
+ Thanks to [John Hawthorn](https://github.com/jhawthorn)
252
+
253
+ * Added stubbed IO on stubbed socket in Net::HTTP adapter.
254
+
255
+ Thanks to [Thilo Rusche](https://github.com/trusche)
256
+
257
+ * When 'webmock/rspec' is required, reset WebMock after all after(:each/example) hooks
258
+
259
+ Thanks to [Andrew Stuntz](https://github.com/drews256)
260
+
261
+ * Fixed `net_connect_allowed?` when invoked with no arguments, when there were any allowed URIs passed to `disable_net_connect?`.
262
+
263
+ Thanks to [Lucas Uyezu](https://github.com/lucasuyezu)
264
+
265
+ * Fixed async-http adapter which caused Async::HTTP::Client or Async::HTTP::Internet to hang and never return a response.
266
+
267
+ Thanks to [Bruno Sutic](https://github.com/bruno-) and [Samuel Williams](https://github.com/ioquatix)
268
+
269
+ * Fixed warning when using async-http adapter
270
+
271
+ Thanks to [Bruno Sutic](https://github.com/bruno-)
272
+
273
+ * Dropped support for Ruby 2.3 - EOL date: 2019-03-31
274
+
275
+ * Dropped support for Ruby 2.4 - EOL date: 2020-03-31
276
+
277
+ * Handling matching of Addressable::Template patterns that have an ip address without port and patterns that have ip address and don’t have schema and path.
278
+
279
+ Thanks to [Rafael França](https://github.com/rafaelfranca) and [guppy0356](https://github.com/guppy0356)
280
+
281
+ ## 3.8.3
282
+
283
+ * Fixed problem introduced in version 3.4.2, which caused matching against Addressable::Template representing host part of the URI to raise an error.
284
+
285
+ Thanks to [Vesa Laakso](https://github.com/valscion)
286
+
287
+ ## 3.8.2
288
+
289
+ * Support correct encoding parameter for HTTP.rb 2.x and earlier
290
+
291
+ Thanks to [Alex Coomans](https://github.com/drcapulet)
292
+
293
+ ## 3.8.1
294
+
295
+ * Added support for mocking non-ASCII bodies when making requests with HTTP.rb
296
+
297
+ Thanks to [Patrik Ragnarsson](https://github.com/dentarg)
298
+
299
+ ## 3.8.0
300
+
301
+ * Fixed options handling when initialising Async::HTTP::Client
302
+
303
+ Thanks to [Samuel Williams](https://github.com/ioquatix)
304
+
305
+ * Ruby 2.7 support.
306
+
307
+ Thanks to [Ryan Davis](https://github.com/zenspider) and [Brandur](https://github.com/brandur)
308
+
309
+ ## 3.7.6
310
+
311
+ * Suppressed keyword argument warnings in Ruby 2.7 in async-http adapter.
312
+
313
+ Thanks to [Koichi ITO](https://github.com/koic)
314
+
315
+ ## 3.7.5
316
+
317
+ * Suppress Excon warning generated by extra key
318
+
319
+ Thanks to [Marco Costa](https://github.com/marcotc)
320
+
321
+ ## 3.7.4
322
+
323
+ * Resetting memoized response fields in Curb adapter.
324
+
325
+ Thanks to [Andrei Sidorov](https://github.com/heretge)
326
+
327
+ ## 3.7.3
328
+
329
+ * Fix for http.rb. Allow passing an output buffer to HTTP::Response::Body#readpartial
330
+
331
+ Thanks to [George Claghorn](https://github.com/georgeclaghorn)
332
+
333
+ * Fixed Manticore adapter to invoke Manticore failure handler on stubbed timeout
334
+
335
+ Thanks to [Alex Junger](https://github.com/alexJunger)
336
+
337
+ * Added project metadata to the gemspec
338
+
339
+ Thanks to [Orien Madgwick](https://github.com/orien)
340
+
341
+ ## 3.7.2
342
+
343
+ * Fixed handling of non UTF-8 encoded urls
344
+
345
+ Thanks to [Rafael França](https://github.com/rafaelfranca)
346
+
347
+ * Fixed "shadowing outer local variable" warning
348
+
349
+ Thanks to [y-yagi](https://github.com/y-yagi)
350
+
351
+ ## 3.7.1
352
+
353
+ * Fixed Async::HTTP::Client adapter code to not cause Ruby warning
354
+
355
+ Thanks to [y-yagi](https://github.com/y-yagi)
356
+
357
+ ## 3.7.0
358
+
359
+ * Support for Async::HTTP::Client
360
+
361
+ Thanks to [Andriy Yanko](https://github.com/ayanko)
362
+
363
+ ## 3.6.2
364
+
365
+ * Fixed Patron adapter to handle HTTP/2 status line.
366
+
367
+ Thanks to [Fábio D. Batista](https://github.com/fabiob)
368
+
369
+ ## 3.6.1
370
+
371
+ * Fixed issue with matching Addressable::Template without a period in the domain
372
+
373
+ Thanks to [Eike Send](https://github.com/eikes)
374
+
375
+ * Support for `write_timeout` in Net::HTTP
376
+
377
+ Thanks to [Claudio Poli](https://github.com/masterkain)
378
+
379
+ * Fixed issue with handling urls with ":80" or ":443" in the path.
380
+
381
+ Thanks to [Csaba Apagyi](https://github.com/thisismydesign) for reporting and to [Frederick Cheung](https://github.com/fcheung) for fixing the issue.
382
+
383
+ ## 3.6.0
384
+
385
+ * Compatibility with the latest version of hashdiff gem, with constant changed from HashDiff to Hashdiff
386
+
387
+ Thanks to [Jeff Felchner](https://github.com/jfelchner)
388
+
389
+ * Added a hint to the error message raised when `with` method is called without args or a block.
390
+
391
+ Thanks to [Adam Sokolnicki](https://github.com/asok)
392
+
393
+ * Resetting configured HTTP method in Curb adapter after each request
394
+
395
+ Thanks to [tiendo1011](https://github.com/tiendo1011)
396
+
397
+ * Added `WebMock.enable_net_connect!` as an alias for `WebMock.allow_net_connect!`
398
+ and `WebMock.disallow_net_connect!` as an alias for `WebMock.disable_net_connect!`
399
+
400
+ Thanks to [SoonKhen OwYong](https://github.com/owyongsk)
401
+
402
+ * Fixed handling of empty arrays as query params when using Faraday
403
+
404
+ Thanks to [Ryan Moret](https://github.com/rcmoret)
405
+
406
+ ## 3.5.1
407
+
408
+ * Disabling TracePoint defined in Net::BufferedIO in case of exception being raised.
409
+
410
+ Thanks to [Koichi Sasada](https://github.com/ko1)
411
+
412
+
413
+ ## 3.5.0
414
+
415
+ * Ruby 2.6.0 support
416
+
417
+ Thanks to [Arkadiy Tetelman](https://github.com/arkadiyt)
418
+
419
+ * Added `WebMock.reset_executed_requests!` method.
420
+
421
+ stub_get = stub_request(:get, "www.example.com")
422
+ Net::HTTP.get('www.example.com', '/')
423
+ WebMock::RequestRegistry.instance.times_executed(stub_get.request_pattern) # => 1
424
+ reset_executed_requests!
425
+ WebMock::RequestRegistry.instance.times_executed(stub_get.request_pattern) # => 0
426
+
427
+ Thanks to [Olia Kremmyda](https://github.com/oliakremmyda)
428
+
429
+ * Performance improvements
430
+
431
+ Thanks to [Pavel Rosický](https://github.com/ahorek)
432
+
433
+ ## 3.4.2
434
+
435
+ * Fixed `rbuf_fill` in Net::HTTP adapter to be thread-safe
436
+
437
+ Thanks to [Arkadiy Tetelman](https://github.com/arkadiyt)
438
+
439
+ * Fix invalid scheme error with Addressable::Template
440
+
441
+ Thanks to [Kazato Sugimoto](https://github.com/uiureo)
442
+
443
+ ## 3.4.1
444
+
445
+ * 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.
446
+
447
+ Thanks to [Lukas Pokorny](https://github.com/luk4s)
448
+
449
+ ## 3.4.0
450
+
451
+ * Ruby 2.6 support. Prevent `Net/ReadTimeout` error in Ruby 2.6
452
+
453
+ Thanks to [Koichi ITO](https://github.com/koic)
454
+
455
+ * Handling query params, which represent nested hashes with keys starting with non word characters.
456
+
457
+ Thanks to [rapides](https://github.com/rapides) for reporting the issue.
458
+
459
+ * Patron adapter handles PATCH requests with body.
460
+
461
+ Thanks to [Mattia](https://github.com/iMacTia) for reporting the issue.
462
+
463
+ * Allowing requests with url encoded body to be matched by request stubs declared with hash body with non-string values.
464
+
465
+ stub_request(:post, "www.example.com").with(body: {"a" => 1, "b" => false})
466
+
467
+ RestClient.post('www.example.com', 'a=1&b=false', :content_type => 'application/x-www-form-urlencoded') # ===> Success
468
+
469
+ Thanks to [Kenny Ortmann](https://github.com/yairgo) for suggesting this feature.
470
+
471
+ * When request headers contain 'Accept'=>'application/json' and no registered stub matches the request, WebMock prints a suggested stub code with to_return body set to '{}'.
472
+
473
+ Thanks to [redbar0n](https://github.com/redbar0n)
474
+
475
+ * Improved suggested stub output when the request stub only contains headers declaration.
476
+
477
+ Thanks to [Olia Kremmyda](https://github.com/oliakremmyda)
478
+
479
+ * Fixed Curb adapter to handle `reset` method.
480
+
481
+ Thanks tp [dinhhuydh](https://github.com/dinhhuydh) for reporting the issue.
482
+ Thanks to [Olia Kremmyda](https://github.com/oliakremmyda) for fixing it.
483
+
484
+
485
+ ## 3.3.0
486
+
487
+ * Better formatting of outputted request stub snippets, displayed on failures due to unstubbed requests.
488
+
489
+ Thanks to [Olia Kremmyda](https://github.com/oliakremmyda)
490
+
491
+
492
+ ## 3.2.1
493
+
494
+ * Fixed Ruby warning under Ruby 2.5
495
+
496
+ Thanks to [Matt Brictson](https://github.com/mattbrictson)
497
+
498
+
499
+ ## 3.2.0
500
+
501
+ * Automatically disable WebMock after Rspec suite
502
+
503
+ Thanks to [Michał Matyas](https://github.com/d4rky-pl)
504
+
505
+ * Fixed bug when handling redirection using Curb.
506
+
507
+ Thanks to [Olia Kremmyda](https://github.com/oliakremmyda)
508
+
509
+
510
+ ## 3.1.1
511
+
512
+ * Warning message is displayed only once when adding query params to URIAddressablePattern.
513
+
514
+ ## 3.1.0
515
+
516
+ * http.rb 3.0.0 compatibility
517
+
518
+ Thanks to [Piotr Boniecki](https://github.com/Bonias)
519
+
520
+ * Typhoeus 1.3.0 support
521
+
522
+ Thanks to [NARUSE, Yui](https://github.com/nurse)
523
+
524
+ * Added support for matching partial query params using hash_excluding
525
+
526
+ stub_request(:get, "www.example.com").
527
+ with(query: hash_excluding({"a" => "b"}))
528
+
529
+ RestClient.get("http://www.example.com/?a=b") # ===> Failure
530
+ RestClient.get("http://www.example.com/?a=c") # ===> Success
531
+
532
+ Thanks to [Olexandr Hoshylyk](https://github.com/Warrior109)
533
+
534
+ * Added MRI 2.3+ frozen string literal compatibility
535
+
536
+ Thanks to [Pat Allan](https://github.com/pat)
537
+
538
+ * Ensured that HTTPClient adapter does not yield block on empty response body if a block is provided
539
+
540
+ Thanks to [NARUSE, Yui](https://github.com/nurse)
541
+
542
+ * Fixed issue with `to_timeout` incorrectly raising `HTTP::ConnectionError` instead of `HTTP::TimeoutError` when using http.rb
543
+
544
+ Thanks to [Rick Song](https://github.com/RickCSong)
545
+
546
+ * Fixed problem with `response.connection.close` method being undefined when using http.rb
547
+
548
+ Thanks to [Janko Marohnić](https://github.com/janko-m)
549
+
550
+ * Fixed problem with matching Net::HTTP request header values assigned as numbers.
551
+
552
+ Thanks to [Felipe Constantino de Oliveira](https://github.com/felipecdo) for reporting the issue.
553
+
554
+ * Fixed problem with Net::HTTP adapter converting empty response body to nil for non 204 responses.
555
+
556
+ Thanks to [Jeffrey Charles](https://github.com/jeffcharles) for reporting the issue.
557
+
558
+
3
559
  ## 3.0.1
4
560
 
5
561
  * Suppressed \`warning: \`&' interpreted as argument prefix\`
@@ -195,9 +751,9 @@
195
751
  * `WebMock.disable_net_connect` accepts `:allow` option with an object that responds to `#call`, receiving a `URI` object and returning a boolean:
196
752
 
197
753
 
198
- blacklist = ['google.com', 'facebook.com', 'apple.com']
754
+ denylist = ['google.com', 'facebook.com', 'apple.com']
199
755
  allowed_sites = lambda{|uri|
200
- blacklist.none?{|site| uri.host.include?(site) }
756
+ denylist.none?{|site| uri.host.include?(site) }
201
757
  }
202
758
  WebMock.disable_net_connect!(:allow => allowed_sites)
203
759