webmock 1.8.6 → 3.14.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.github/workflows/CI.yml +37 -0
- data/.gitignore +6 -0
- data/CHANGELOG.md +1198 -0
- data/Gemfile +3 -15
- data/README.md +761 -305
- data/Rakefile +13 -40
- data/lib/webmock/api.rb +63 -17
- data/lib/webmock/callback_registry.rb +1 -1
- data/lib/webmock/config.rb +8 -0
- data/lib/webmock/cucumber.rb +2 -0
- data/lib/webmock/errors.rb +8 -24
- data/lib/webmock/http_lib_adapters/async_http_client_adapter.rb +216 -0
- data/lib/webmock/http_lib_adapters/curb_adapter.rb +148 -84
- data/lib/webmock/http_lib_adapters/em_http_request_adapter.rb +224 -4
- data/lib/webmock/http_lib_adapters/excon_adapter.rb +104 -34
- data/lib/webmock/http_lib_adapters/http_rb/client.rb +17 -0
- data/lib/webmock/http_lib_adapters/http_rb/request.rb +16 -0
- data/lib/webmock/http_lib_adapters/http_rb/response.rb +64 -0
- data/lib/webmock/http_lib_adapters/http_rb/streamer.rb +29 -0
- data/lib/webmock/http_lib_adapters/http_rb/webmock.rb +68 -0
- data/lib/webmock/http_lib_adapters/http_rb_adapter.rb +37 -0
- data/lib/webmock/http_lib_adapters/httpclient_adapter.rb +152 -86
- data/lib/webmock/http_lib_adapters/manticore_adapter.rb +145 -0
- data/lib/webmock/http_lib_adapters/net_http.rb +155 -46
- data/lib/webmock/http_lib_adapters/net_http_response.rb +1 -1
- data/lib/webmock/http_lib_adapters/patron_adapter.rb +16 -15
- data/lib/webmock/http_lib_adapters/typhoeus_hydra_adapter.rb +76 -82
- data/lib/webmock/matchers/any_arg_matcher.rb +13 -0
- data/lib/webmock/matchers/hash_argument_matcher.rb +21 -0
- data/lib/webmock/matchers/hash_excluding_matcher.rb +15 -0
- data/lib/webmock/matchers/hash_including_matcher.rb +4 -12
- data/lib/webmock/minitest.rb +29 -3
- data/lib/webmock/rack_response.rb +14 -7
- data/lib/webmock/request_body_diff.rb +64 -0
- data/lib/webmock/request_execution_verifier.rb +38 -17
- data/lib/webmock/request_pattern.rb +158 -38
- data/lib/webmock/request_registry.rb +3 -3
- data/lib/webmock/request_signature.rb +7 -3
- data/lib/webmock/request_signature_snippet.rb +61 -0
- data/lib/webmock/request_stub.rb +9 -6
- data/lib/webmock/response.rb +30 -15
- data/lib/webmock/rspec/matchers/request_pattern_matcher.rb +38 -2
- data/lib/webmock/rspec/matchers/webmock_matcher.rb +23 -2
- data/lib/webmock/rspec/matchers.rb +0 -1
- data/lib/webmock/rspec.rb +11 -2
- data/lib/webmock/stub_registry.rb +31 -10
- data/lib/webmock/stub_request_snippet.rb +14 -6
- data/lib/webmock/test_unit.rb +4 -4
- data/lib/webmock/util/hash_counter.rb +20 -6
- data/lib/webmock/util/hash_keys_stringifier.rb +5 -3
- data/lib/webmock/util/hash_validator.rb +17 -0
- data/lib/webmock/util/headers.rb +23 -2
- data/lib/webmock/util/json.rb +20 -7
- data/lib/webmock/util/query_mapper.rb +281 -0
- data/lib/webmock/util/uri.rb +29 -19
- data/lib/webmock/util/values_stringifier.rb +20 -0
- data/lib/webmock/util/version_checker.rb +40 -2
- data/lib/webmock/version.rb +1 -1
- data/lib/webmock/webmock.rb +56 -17
- data/lib/webmock.rb +56 -46
- data/minitest/test_helper.rb +8 -3
- data/minitest/test_webmock.rb +4 -1
- data/minitest/webmock_spec.rb +16 -6
- data/spec/acceptance/async_http_client/async_http_client_spec.rb +375 -0
- data/spec/acceptance/async_http_client/async_http_client_spec_helper.rb +73 -0
- data/spec/acceptance/curb/curb_spec.rb +227 -68
- data/spec/acceptance/curb/curb_spec_helper.rb +11 -8
- data/spec/acceptance/em_http_request/em_http_request_spec.rb +322 -28
- data/spec/acceptance/em_http_request/em_http_request_spec_helper.rb +15 -10
- data/spec/acceptance/excon/excon_spec.rb +66 -4
- data/spec/acceptance/excon/excon_spec_helper.rb +21 -7
- data/spec/acceptance/http_rb/http_rb_spec.rb +93 -0
- data/spec/acceptance/http_rb/http_rb_spec_helper.rb +54 -0
- data/spec/acceptance/httpclient/httpclient_spec.rb +152 -11
- data/spec/acceptance/httpclient/httpclient_spec_helper.rb +25 -16
- data/spec/acceptance/manticore/manticore_spec.rb +107 -0
- data/spec/acceptance/manticore/manticore_spec_helper.rb +35 -0
- data/spec/acceptance/net_http/net_http_shared.rb +52 -24
- data/spec/acceptance/net_http/net_http_spec.rb +164 -50
- data/spec/acceptance/net_http/net_http_spec_helper.rb +19 -10
- data/spec/acceptance/net_http/real_net_http_spec.rb +1 -1
- data/spec/acceptance/patron/patron_spec.rb +29 -40
- data/spec/acceptance/patron/patron_spec_helper.rb +15 -11
- data/spec/acceptance/shared/allowing_and_disabling_net_connect.rb +229 -58
- data/spec/acceptance/shared/callbacks.rb +32 -30
- data/spec/acceptance/shared/complex_cross_concern_behaviors.rb +20 -5
- data/spec/acceptance/shared/enabling_and_disabling_webmock.rb +14 -14
- data/spec/acceptance/shared/precedence_of_stubs.rb +6 -6
- data/spec/acceptance/shared/request_expectations.rb +560 -296
- data/spec/acceptance/shared/returning_declared_responses.rb +180 -138
- data/spec/acceptance/shared/stubbing_requests.rb +385 -154
- data/spec/acceptance/typhoeus/typhoeus_hydra_spec.rb +78 -17
- data/spec/acceptance/typhoeus/typhoeus_hydra_spec_helper.rb +19 -15
- data/spec/acceptance/webmock_shared.rb +2 -2
- data/spec/fixtures/test.txt +1 -0
- data/spec/quality_spec.rb +27 -3
- data/spec/spec_helper.rb +11 -20
- data/spec/support/failures.rb +9 -0
- data/spec/support/my_rack_app.rb +8 -3
- data/spec/support/network_connection.rb +7 -13
- data/spec/support/webmock_server.rb +8 -3
- data/spec/unit/api_spec.rb +175 -0
- data/spec/unit/errors_spec.rb +116 -19
- data/spec/unit/http_lib_adapters/http_lib_adapter_registry_spec.rb +1 -1
- data/spec/unit/http_lib_adapters/http_lib_adapter_spec.rb +2 -2
- data/spec/unit/matchers/hash_excluding_matcher_spec.rb +61 -0
- data/spec/unit/matchers/hash_including_matcher_spec.rb +87 -0
- data/spec/unit/rack_response_spec.rb +54 -16
- data/spec/unit/request_body_diff_spec.rb +90 -0
- data/spec/unit/request_execution_verifier_spec.rb +147 -39
- data/spec/unit/request_pattern_spec.rb +462 -198
- data/spec/unit/request_registry_spec.rb +29 -9
- data/spec/unit/request_signature_snippet_spec.rb +89 -0
- data/spec/unit/request_signature_spec.rb +91 -49
- data/spec/unit/request_stub_spec.rb +71 -70
- data/spec/unit/response_spec.rb +100 -81
- data/spec/unit/stub_registry_spec.rb +37 -20
- data/spec/unit/stub_request_snippet_spec.rb +51 -31
- data/spec/unit/util/hash_counter_spec.rb +6 -6
- data/spec/unit/util/hash_keys_stringifier_spec.rb +4 -4
- data/spec/unit/util/headers_spec.rb +4 -4
- data/spec/unit/util/json_spec.rb +29 -3
- data/spec/unit/util/query_mapper_spec.rb +157 -0
- data/spec/unit/util/uri_spec.rb +150 -36
- data/spec/unit/util/version_checker_spec.rb +15 -9
- data/spec/unit/webmock_spec.rb +57 -4
- data/test/http_request.rb +3 -3
- data/test/shared_test.rb +45 -13
- data/test/test_helper.rb +1 -1
- data/test/test_webmock.rb +6 -0
- data/webmock.gemspec +30 -11
- metadata +308 -199
- data/.rvmrc +0 -1
- data/.travis.yml +0 -11
- data/Guardfile +0 -24
- data/lib/webmock/http_lib_adapters/em_http_request/em_http_request_0_x.rb +0 -151
- data/lib/webmock/http_lib_adapters/em_http_request/em_http_request_1_x.rb +0 -210
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,1203 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
+
# 3.14.0
|
4
|
+
|
5
|
+
* Bump Addressable from 2.3.6 to 2.8.0
|
6
|
+
|
7
|
+
Thanks to [Eduardo Hernandez](https://github.com/EduardoGHdez)
|
8
|
+
|
9
|
+
# 3.13.0
|
10
|
+
|
11
|
+
* Support http.rb 5.x
|
12
|
+
|
13
|
+
Thanks to [Will Storey](https://github.com/horgh)
|
14
|
+
|
15
|
+
# 3.12.2
|
16
|
+
|
17
|
+
* Fixed em-http-request adapter to avoid calling middleware twice.
|
18
|
+
|
19
|
+
Thanks to [Alex Vondrak](https://github.com/ajvondrak)
|
20
|
+
|
21
|
+
# 3.12.1
|
22
|
+
|
23
|
+
* Fixed handling of URIs with IPv6 addresses with square brackets when in Net::HTTP adapter.
|
24
|
+
|
25
|
+
Thanks to [Johanna Hartmann](https://github.com/JohannaHartmann)
|
26
|
+
|
27
|
+
# 3.12.0
|
28
|
+
|
29
|
+
* Added support for handling custom JSON and XML content types e.g. 'application/vnd.api+json'
|
30
|
+
|
31
|
+
# 3.11.3
|
32
|
+
|
33
|
+
* Fixed async-http adapter to only considered requests as real if they are real.
|
34
|
+
|
35
|
+
Thanks to Thanks to [Tony Schneider](https://github.com/tonywok) and [Samuel Williams](https://github.com/ioquatix)
|
36
|
+
|
37
|
+
# 3.11.2
|
38
|
+
|
39
|
+
* Fix for Manticore streaming mode
|
40
|
+
|
41
|
+
Thanks to [Oleksiy Kovyrin](https://github.com/kovyrin)
|
42
|
+
|
43
|
+
# 3.11.1
|
44
|
+
|
45
|
+
* Compatibility with async-http 0.54+
|
46
|
+
|
47
|
+
Thanks to [Jun Jiang](https://github.com/jasl)
|
48
|
+
|
49
|
+
# 3.11.0
|
50
|
+
|
51
|
+
* Added support for `features` in http.rb adapter.
|
52
|
+
|
53
|
+
Thanks to [Carl (ce07c3)](https://github.com/ce07c3)
|
54
|
+
|
55
|
+
# 3.10.0
|
56
|
+
|
57
|
+
* Added option to global stubs to have lower priority than local stubs.
|
58
|
+
|
59
|
+
WebMock.globally_stub_request(:after_local_stubs) do
|
60
|
+
{ body: "global stub body" }
|
61
|
+
end
|
62
|
+
|
63
|
+
stub_request(:get, "www.example.com").to_return(body: 'non-global stub body')
|
64
|
+
|
65
|
+
expect(http_request(:get, "http://www.example.com/").body).to eq("non-global stub body")
|
66
|
+
|
67
|
+
Thanks to [Marek Kasztelnik](https://github.com/mkasztelnik)
|
68
|
+
|
69
|
+
# 3.9.5
|
70
|
+
|
71
|
+
* Prevent overwriting `teardown` method in Test::Unit
|
72
|
+
|
73
|
+
Thanks to [Jesse Bowes](https://github.com/jessebs)
|
74
|
+
|
75
|
+
# 3.9.4
|
76
|
+
|
77
|
+
* More intuitive error message when stubbed response body was provided as Hash
|
78
|
+
|
79
|
+
Thanks to [Ben Koshy](https://github.com/BKSpurgeon)
|
80
|
+
|
81
|
+
# 3.9.3
|
82
|
+
|
83
|
+
* Make httpclient_adapter thread-safe
|
84
|
+
|
85
|
+
Thanks to [Adam Harwood](https://github.com/adam-harwood)
|
86
|
+
|
87
|
+
# 3.9.2
|
88
|
+
|
89
|
+
* Made global stubs thread-safe
|
90
|
+
|
91
|
+
Thanks to [Adam Harwood](https://github.com/adam-harwood)
|
92
|
+
|
93
|
+
# 3.9.1
|
94
|
+
|
95
|
+
* Fixed support for passing `URI` objects as second argument of `stub_request`
|
96
|
+
|
97
|
+
Thanks to [Ryan Kerr](https://github.com/leboshi)
|
98
|
+
|
99
|
+
## 3.9.0
|
100
|
+
|
101
|
+
* Allow using a "callable" (like a proc) as URI pattern
|
102
|
+
|
103
|
+
stub_request(:any, ->(uri) { true })
|
104
|
+
|
105
|
+
Thanks to [John Hawthorn](https://github.com/jhawthorn)
|
106
|
+
|
107
|
+
* Added stubbed IO on stubbed socket in Net::HTTP adapter.
|
108
|
+
|
109
|
+
Thanks to [Thilo Rusche](https://github.com/trusche)
|
110
|
+
|
111
|
+
* When 'webmock/rspec' is required, reset WebMock after all after(:each/example) hooks
|
112
|
+
|
113
|
+
Thanks to [Andrew Stuntz](https://github.com/drews256)
|
114
|
+
|
115
|
+
* Fixed `net_connect_allowed?` when invoked with no arguments, when there were any allowed URIs passed to `disable_net_connect?`.
|
116
|
+
|
117
|
+
Thanks to [Lucas Uyezu](https://github.com/lucasuyezu)
|
118
|
+
|
119
|
+
* Fixed async-http adapter which caused Async::HTTP::Client or Async::HTTP::Internet to hang and never return a response.
|
120
|
+
|
121
|
+
Thanks to [Bruno Sutic](https://github.com/bruno-) and [Samuel Williams](https://github.com/ioquatix)
|
122
|
+
|
123
|
+
* Fixed warning when using async-http adapter
|
124
|
+
|
125
|
+
Thanks to [Bruno Sutic](https://github.com/bruno-)
|
126
|
+
|
127
|
+
* Dropped support for Ruby 2.3 - EOL date: 2019-03-31
|
128
|
+
|
129
|
+
* Dropped support for Ruby 2.4 - EOL date: 2020-03-31
|
130
|
+
|
131
|
+
* 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.
|
132
|
+
|
133
|
+
Thanks to [Rafael França](https://github.com/rafaelfranca) and [guppy0356](https://github.com/guppy0356)
|
134
|
+
|
135
|
+
## 3.8.3
|
136
|
+
|
137
|
+
* Fixed problem introduced in version 3.4.2, which caused matching against Addressable::Template representing host part of the URI to raise an error.
|
138
|
+
|
139
|
+
Thanks to [Vesa Laakso](https://github.com/valscion)
|
140
|
+
|
141
|
+
## 3.8.2
|
142
|
+
|
143
|
+
* Support correct encoding parameter for HTTP.rb 2.x and earlier
|
144
|
+
|
145
|
+
Thanks to [Alex Coomans](https://github.com/drcapulet)
|
146
|
+
|
147
|
+
## 3.8.1
|
148
|
+
|
149
|
+
* Added support for mocking non-ASCII bodies when making requests with HTTP.rb
|
150
|
+
|
151
|
+
Thanks to [Patrik Ragnarsson](https://github.com/dentarg)
|
152
|
+
|
153
|
+
## 3.8.0
|
154
|
+
|
155
|
+
* Fixed options handling when initialising Async::HTTP::Client
|
156
|
+
|
157
|
+
Thanks to [Samuel Williams](https://github.com/ioquatix)
|
158
|
+
|
159
|
+
* Ruby 2.7 support.
|
160
|
+
|
161
|
+
Thanks to [Ryan Davis](https://github.com/zenspider) and [Brandur](https://github.com/brandur)
|
162
|
+
|
163
|
+
## 3.7.6
|
164
|
+
|
165
|
+
* Suppressed keyword argument warnings in Ruby 2.7 in async-http adapter.
|
166
|
+
|
167
|
+
Thanks to [Koichi ITO](https://github.com/koic)
|
168
|
+
|
169
|
+
## 3.7.5
|
170
|
+
|
171
|
+
* Suppress Excon warning generated by extra key
|
172
|
+
|
173
|
+
Thanks to [Marco Costa](https://github.com/marcotc)
|
174
|
+
|
175
|
+
## 3.7.4
|
176
|
+
|
177
|
+
* Resetting memoized response fields in Curb adapter.
|
178
|
+
|
179
|
+
Thanks to [Andrei Sidorov](https://github.com/heretge)
|
180
|
+
|
181
|
+
## 3.7.3
|
182
|
+
|
183
|
+
* Fix for http.rb. Allow passing an output buffer to HTTP::Response::Body#readpartial
|
184
|
+
|
185
|
+
Thanks to [George Claghorn](https://github.com/georgeclaghorn)
|
186
|
+
|
187
|
+
* Fixed Manticore adapter to invoke Manticore failure handler on stubbed timeout
|
188
|
+
|
189
|
+
Thanks to [Alex Junger](https://github.com/alexJunger)
|
190
|
+
|
191
|
+
* Added project metadata to the gemspec
|
192
|
+
|
193
|
+
Thanks to [Orien Madgwick](https://github.com/orien)
|
194
|
+
|
195
|
+
## 3.7.2
|
196
|
+
|
197
|
+
* Fixed handling of non UTF-8 encoded urls
|
198
|
+
|
199
|
+
Thanks to [Rafael França](https://github.com/rafaelfranca)
|
200
|
+
|
201
|
+
* Fixed "shadowing outer local variable" warning
|
202
|
+
|
203
|
+
Thanks to [y-yagi](https://github.com/y-yagi)
|
204
|
+
|
205
|
+
## 3.7.1
|
206
|
+
|
207
|
+
* Fixed Async::HTTP::Client adapter code to not cause Ruby warning
|
208
|
+
|
209
|
+
Thanks to [y-yagi](https://github.com/y-yagi)
|
210
|
+
|
211
|
+
## 3.7.0
|
212
|
+
|
213
|
+
* Support for Async::HTTP::Client
|
214
|
+
|
215
|
+
Thanks to [Andriy Yanko](https://github.com/ayanko)
|
216
|
+
|
217
|
+
## 3.6.2
|
218
|
+
|
219
|
+
* Fixed Patron adapter to handle HTTP/2 status line.
|
220
|
+
|
221
|
+
Thanks to [Fábio D. Batista](https://github.com/fabiob)
|
222
|
+
|
223
|
+
## 3.6.1
|
224
|
+
|
225
|
+
* Fixed issue with matching Addressable::Template without a period in the domain
|
226
|
+
|
227
|
+
Thanks to [Eike Send](https://github.com/eikes)
|
228
|
+
|
229
|
+
* Support for `write_timeout` in Net::HTTP
|
230
|
+
|
231
|
+
Thanks to [Claudio Poli](https://github.com/masterkain)
|
232
|
+
|
233
|
+
* Fixed issue with handling urls with ":80" or ":443" in the path.
|
234
|
+
|
235
|
+
Thanks to [Csaba Apagyi](https://github.com/thisismydesign) for reporting and to [Frederick Cheung](https://github.com/fcheung) for fixing the issue.
|
236
|
+
|
237
|
+
## 3.6.0
|
238
|
+
|
239
|
+
* Compatibility with the latest version of hashdiff gem, with constant changed from HashDiff to Hashdiff
|
240
|
+
|
241
|
+
Thanks to [Jeff Felchner](https://github.com/jfelchner)
|
242
|
+
|
243
|
+
* Added a hint to the error message raised when `with` method is called without args or a block.
|
244
|
+
|
245
|
+
Thanks to [Adam Sokolnicki](https://github.com/asok)
|
246
|
+
|
247
|
+
* Resetting configured HTTP method in Curb adapter after each request
|
248
|
+
|
249
|
+
Thanks to [tiendo1011](https://github.com/tiendo1011)
|
250
|
+
|
251
|
+
* Added `WebMock.enable_net_connect!` as an alias for `WebMock.allow_net_connect!`
|
252
|
+
and `WebMock.disallow_net_connect!` as an alias for `WebMock.disable_net_connect!`
|
253
|
+
|
254
|
+
Thanks to [SoonKhen OwYong](https://github.com/owyongsk)
|
255
|
+
|
256
|
+
* Fixed handling of empty arrays as query params when using Faraday
|
257
|
+
|
258
|
+
Thanks to [Ryan Moret](https://github.com/rcmoret)
|
259
|
+
|
260
|
+
## 3.5.1
|
261
|
+
|
262
|
+
* Disabling TracePoint defined in Net::BufferedIO in case of exception being raised.
|
263
|
+
|
264
|
+
Thanks to [Koichi Sasada](https://github.com/ko1)
|
265
|
+
|
266
|
+
|
267
|
+
## 3.5.0
|
268
|
+
|
269
|
+
* Ruby 2.6.0 support
|
270
|
+
|
271
|
+
Thanks to [Arkadiy Tetelman](https://github.com/arkadiyt)
|
272
|
+
|
273
|
+
* Added `WebMock.reset_executed_requests!` method.
|
274
|
+
|
275
|
+
stub_get = stub_request(:get, "www.example.com")
|
276
|
+
Net::HTTP.get('www.example.com', '/')
|
277
|
+
WebMock::RequestRegistry.instance.times_executed(stub_get.request_pattern) # => 1
|
278
|
+
reset_executed_requests!
|
279
|
+
WebMock::RequestRegistry.instance.times_executed(stub_get.request_pattern) # => 0
|
280
|
+
|
281
|
+
Thanks to [Olia Kremmyda](https://github.com/oliakremmyda)
|
282
|
+
|
283
|
+
* Performance improvements
|
284
|
+
|
285
|
+
Thanks to [Pavel Rosický](https://github.com/ahorek)
|
286
|
+
|
287
|
+
## 3.4.2
|
288
|
+
|
289
|
+
* Fixed `rbuf_fill` in Net::HTTP adapter to be thread-safe
|
290
|
+
|
291
|
+
Thanks to [Arkadiy Tetelman](https://github.com/arkadiyt)
|
292
|
+
|
293
|
+
* Fix invalid scheme error with Addressable::Template
|
294
|
+
|
295
|
+
Thanks to [Kazato Sugimoto](https://github.com/uiureo)
|
296
|
+
|
297
|
+
## 3.4.1
|
298
|
+
|
299
|
+
* 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.
|
300
|
+
|
301
|
+
Thanks to [Lukas Pokorny](https://github.com/luk4s)
|
302
|
+
|
303
|
+
## 3.4.0
|
304
|
+
|
305
|
+
* Ruby 2.6 support. Prevent `Net/ReadTimeout` error in Ruby 2.6
|
306
|
+
|
307
|
+
Thanks to [Koichi ITO](https://github.com/koic)
|
308
|
+
|
309
|
+
* Handling query params, which represent nested hashes with keys starting with non word characters.
|
310
|
+
|
311
|
+
Thanks to [rapides](https://github.com/rapides) for reporting the issue.
|
312
|
+
|
313
|
+
* Patron adapter handles PATCH requests with body.
|
314
|
+
|
315
|
+
Thanks to [Mattia](https://github.com/iMacTia) for reporting the issue.
|
316
|
+
|
317
|
+
* Allowing requests with url encoded body to be matched by request stubs declared with hash body with non-string values.
|
318
|
+
|
319
|
+
stub_request(:post, "www.example.com").with(body: {"a" => 1, "b" => false})
|
320
|
+
|
321
|
+
RestClient.post('www.example.com', 'a=1&b=false', :content_type => 'application/x-www-form-urlencoded') # ===> Success
|
322
|
+
|
323
|
+
Thanks to [Kenny Ortmann](https://github.com/yairgo) for suggesting this feature.
|
324
|
+
|
325
|
+
* 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 '{}'.
|
326
|
+
|
327
|
+
Thanks to [redbar0n](https://github.com/redbar0n)
|
328
|
+
|
329
|
+
* Improved suggested stub output when the request stub only contains headers declaration.
|
330
|
+
|
331
|
+
Thanks to [Olia Kremmyda](https://github.com/oliakremmyda)
|
332
|
+
|
333
|
+
* Fixed Curb adapter to handle `reset` method.
|
334
|
+
|
335
|
+
Thanks tp [dinhhuydh](https://github.com/dinhhuydh) for reporting the issue.
|
336
|
+
Thanks to [Olia Kremmyda](https://github.com/oliakremmyda) for fixing it.
|
337
|
+
|
338
|
+
|
339
|
+
## 3.3.0
|
340
|
+
|
341
|
+
* Better formatting of outputted request stub snippets, displayed on failures due to unstubbed requests.
|
342
|
+
|
343
|
+
Thanks to [Olia Kremmyda](https://github.com/oliakremmyda)
|
344
|
+
|
345
|
+
|
346
|
+
## 3.2.1
|
347
|
+
|
348
|
+
* Fixed Ruby warning under Ruby 2.5
|
349
|
+
|
350
|
+
Thanks to [Matt Brictson](https://github.com/mattbrictson)
|
351
|
+
|
352
|
+
|
353
|
+
## 3.2.0
|
354
|
+
|
355
|
+
* Automatically disable WebMock after Rspec suite
|
356
|
+
|
357
|
+
Thanks to [Michał Matyas](https://github.com/d4rky-pl)
|
358
|
+
|
359
|
+
* Fixed bug when handling redirection using Curb.
|
360
|
+
|
361
|
+
Thanks to [Olia Kremmyda](https://github.com/oliakremmyda)
|
362
|
+
|
363
|
+
|
364
|
+
## 3.1.1
|
365
|
+
|
366
|
+
* Warning message is displayed only once when adding query params to URIAddressablePattern.
|
367
|
+
|
368
|
+
## 3.1.0
|
369
|
+
|
370
|
+
* http.rb 3.0.0 compatibility
|
371
|
+
|
372
|
+
Thanks to [Piotr Boniecki](https://github.com/Bonias)
|
373
|
+
|
374
|
+
* Typhoeus 1.3.0 support
|
375
|
+
|
376
|
+
Thanks to [NARUSE, Yui](https://github.com/nurse)
|
377
|
+
|
378
|
+
* Added support for matching partial query params using hash_excluding
|
379
|
+
|
380
|
+
stub_request(:get, "www.example.com").
|
381
|
+
with(query: hash_excluding({"a" => "b"}))
|
382
|
+
|
383
|
+
RestClient.get("http://www.example.com/?a=b") # ===> Failure
|
384
|
+
RestClient.get("http://www.example.com/?a=c") # ===> Success
|
385
|
+
|
386
|
+
Thanks to [Olexandr Hoshylyk](https://github.com/Warrior109)
|
387
|
+
|
388
|
+
* Added MRI 2.3+ frozen string literal compatibility
|
389
|
+
|
390
|
+
Thanks to [Pat Allan](https://github.com/pat)
|
391
|
+
|
392
|
+
* Ensured that HTTPClient adapter does not yield block on empty response body if a block is provided
|
393
|
+
|
394
|
+
Thanks to [NARUSE, Yui](https://github.com/nurse)
|
395
|
+
|
396
|
+
* Fixed issue with `to_timeout` incorrectly raising `HTTP::ConnectionError` instead of `HTTP::TimeoutError` when using http.rb
|
397
|
+
|
398
|
+
Thanks to [Rick Song](https://github.com/RickCSong)
|
399
|
+
|
400
|
+
* Fixed problem with `response.connection.close` method being undefined when using http.rb
|
401
|
+
|
402
|
+
Thanks to [Janko Marohnić](https://github.com/janko-m)
|
403
|
+
|
404
|
+
* Fixed problem with matching Net::HTTP request header values assigned as numbers.
|
405
|
+
|
406
|
+
Thanks to [Felipe Constantino de Oliveira](https://github.com/felipecdo) for reporting the issue.
|
407
|
+
|
408
|
+
* Fixed problem with Net::HTTP adapter converting empty response body to nil for non 204 responses.
|
409
|
+
|
410
|
+
Thanks to [Jeffrey Charles](https://github.com/jeffcharles) for reporting the issue.
|
411
|
+
|
412
|
+
|
413
|
+
## 3.0.1
|
414
|
+
|
415
|
+
* Suppressed \`warning: \`&' interpreted as argument prefix\`
|
416
|
+
|
417
|
+
Thanks to [Koichi ITO](https://github.com/koic)
|
418
|
+
|
419
|
+
## 3.0.0
|
420
|
+
|
421
|
+
* Dropped support for Ruby 1.9.3
|
422
|
+
|
423
|
+
* Using Ruby >= 1.9 hash key syntax in stub suggestions
|
424
|
+
|
425
|
+
Thanks to [Tarmo Tänav](https://github.com/tarmo)
|
426
|
+
|
427
|
+
* Add at_least matchers for fakeweb-style expectations
|
428
|
+
|
429
|
+
Thanks to [Joe Marty](https://github.com/mltsy)
|
430
|
+
|
431
|
+
* Fix against "can't modify frozen String' error when Ruby option `frozen_string_literal` is enabled.
|
432
|
+
|
433
|
+
Thanks to [Chris Thomson](https://github.com/christhomson)
|
434
|
+
|
435
|
+
* Handling `read_timeout` option in Net::HTTP in Ruby >= 2.4
|
436
|
+
|
437
|
+
Thanks to [Christof Koenig](https://github.com/ckoenig)
|
438
|
+
|
439
|
+
* `RequestRegistry` fix for `RuntimeError - can't add a new key into hash during iteration`
|
440
|
+
|
441
|
+
Thanks to [Chung-Yi Chi](https://github.com/starsirius)
|
442
|
+
|
443
|
+
## 2.3.2
|
444
|
+
|
445
|
+
* Restored support for Ruby 1.9.3 to comply with semantic versioning.
|
446
|
+
|
447
|
+
Thanks to [Jordan Harband](https://github.com/ljharb) for reporting the problem.
|
448
|
+
|
449
|
+
## 2.3.1
|
450
|
+
|
451
|
+
* Added support for Ruby 2.4
|
452
|
+
|
453
|
+
Thanks to [Koichi ITO](https://github.com/koic)
|
454
|
+
|
455
|
+
* Dropped support for Ruby 1.9.3
|
456
|
+
|
457
|
+
## 2.2.0
|
458
|
+
|
459
|
+
* Added `refute_requested` as an alias for `assert_not_requested`
|
460
|
+
|
461
|
+
Thanks to [Michael Grosser](https://github.com/grosser)
|
462
|
+
|
463
|
+
* Raising `Net::OpenTimeout` instead of `Timeout::Error` if available when a request stub is declared `to_timeout`
|
464
|
+
|
465
|
+
Thanks to [Gabe Martin-Dempesy](https://github.com/gabetax)
|
466
|
+
|
467
|
+
## 2.1.1
|
468
|
+
|
469
|
+
* Added support for handling status messages in Excon responses.
|
470
|
+
|
471
|
+
Thanks to [Tero Marttila](https://github.com/SpComb) for reporting the issue.
|
472
|
+
|
473
|
+
## 2.1.0
|
474
|
+
|
475
|
+
* Added support for `on_debug` callback in Curb.
|
476
|
+
|
477
|
+
Thanks to [Pavel Jurašek](https://github.com/pavel-jurasek-bcgdv-com)
|
478
|
+
|
479
|
+
* Added support for PATCH requests using Curb.
|
480
|
+
|
481
|
+
Thanks to [Pavel Jurašek](https://github.com/pavel-jurasek-bcgdv-com)
|
482
|
+
|
483
|
+
## 2.0.3
|
484
|
+
|
485
|
+
* Handling headers passed as an Array to Curl::Easy
|
486
|
+
|
487
|
+
Thanks to [Chelsea](https://github.com/grosscr) for reporting the issue.
|
488
|
+
|
489
|
+
* Removed Ruby warnings.
|
490
|
+
|
491
|
+
Thanks to [Aaron Kromer](https://github.com/cupakromer)
|
492
|
+
|
493
|
+
## 2.0.2
|
494
|
+
|
495
|
+
* Using `Base64.strict_encode64` instead of `Base64.encode64` to handle long user:pass basic auth credentials
|
496
|
+
|
497
|
+
Thanks to [Jonathan Schatz](https://github.com/modosc)
|
498
|
+
|
499
|
+
* Fixed handling of Authorisation header provided as string instead of array when using em-http-request.
|
500
|
+
|
501
|
+
Thanks to [Michael Richardson](https://github.com/TTransmit) for reporing the issue.
|
502
|
+
|
503
|
+
* Ensured `WebMock.net_connect_explicit_allowed?` always returns boolean.
|
504
|
+
|
505
|
+
Thanks tp [Jose Luis Honorato](https://github.com/jlhonora)
|
506
|
+
|
507
|
+
## 2.0.1
|
508
|
+
|
509
|
+
* Added code responsible for loading em-http-request if available, which has been removed by mistake.
|
510
|
+
|
511
|
+
Thanks to [Vasiliy](https://github.com/304)
|
512
|
+
|
513
|
+
* WebMock loads "base64" if it's not yet loaded.
|
514
|
+
|
515
|
+
Thanks to [Taiki Ono](https://github.com/taiki45).
|
516
|
+
|
517
|
+
## 2.0.0
|
518
|
+
|
519
|
+
* `require 'webmock'` does not enable WebMock anymore. `gem 'webmock'` can now be safely added to a Gemfile and no http client libs will be modified when it's loaded. Call `WebMock.enable!` to enable WebMock.
|
520
|
+
|
521
|
+
Please note that `require 'webmock/rspec'`, `require 'webmock/test_unit'`, `require 'webmock/minitest'` and `require 'webmock/cucumber'` still do enable WebMock.
|
522
|
+
|
523
|
+
* Dropped support for Ruby < 1.9.3
|
524
|
+
|
525
|
+
* Dropped support for em-http-request < 1.0.0
|
526
|
+
|
527
|
+
* WebMock 2.0 does not match basic authentication credentials in the userinfo part of the url, with credentials passed in `Authorization: Basic ...` header anymore.
|
528
|
+
It now treats the Authorization header and credentials in the userinfo part of a url as two completely separate attributes of a request.
|
529
|
+
|
530
|
+
The following stub declaration, which used to work in WebMock 1.x, is not going to work anymore
|
531
|
+
|
532
|
+
stub_request(:get, "user:pass@www.example.com")
|
533
|
+
|
534
|
+
Net::HTTP.start('www.example.com') do |http|
|
535
|
+
req = Net::HTTP::Get.new('/')
|
536
|
+
req.basic_auth 'user', 'pass'
|
537
|
+
http.request(req)
|
538
|
+
end # ===> Failure
|
539
|
+
|
540
|
+
In order to stub a request with basic authentication credentials provided in the Authorization header, please use the following code:
|
541
|
+
|
542
|
+
stub_request(:get, "www.example.com").with(basic_auth: ['user', 'pass'])
|
543
|
+
|
544
|
+
or
|
545
|
+
|
546
|
+
stub_request(:get, "www.example.com").
|
547
|
+
with(headers: 'Authorization' => "Basic #{ Base64.strict_encode64('user:pass').chomp}")
|
548
|
+
|
549
|
+
In order to stub a request with basic authentication credentials provided in the url, please use the following code:
|
550
|
+
|
551
|
+
stub_request(:get, "user:pass@www.example.com")
|
552
|
+
|
553
|
+
RestClient.get('user:pass@www.example.com') # ===> Success
|
554
|
+
|
555
|
+
## 1.24.6
|
556
|
+
|
557
|
+
* Fixed issue with RUBY_VERSION comparison using old RubyGems.
|
558
|
+
|
559
|
+
Thanks to [Chris Griego](https://github.com/cgriego).
|
560
|
+
|
561
|
+
* Support for http.rb >= 2.0.0
|
562
|
+
|
563
|
+
## 1.24.4
|
564
|
+
|
565
|
+
* Fixed the issue with parsing query to a hash with nested array i.e. `a[][b][]=one&a[][c][]=two`
|
566
|
+
|
567
|
+
Thanks to [Tim Diggins](https://github.com/timdiggins) for reporting the issue.
|
568
|
+
Thanks to [Cedric Pimenta](https://github.com/cedricpim) for finding the solution.
|
569
|
+
|
570
|
+
## 1.24.3
|
571
|
+
|
572
|
+
* Allow Net:HTTP headers keys to be provided as symbols if `RUBY_VERSION` >= 2.3.0
|
573
|
+
|
574
|
+
Thanks to [Alex Kestner](https://github.com/akestner)
|
575
|
+
|
576
|
+
* Added a clear message on an attempt to match a multipart encoded request body.
|
577
|
+
WebMock doesn't support requests with multipart body... yet.
|
578
|
+
|
579
|
+
* `WebMock.disable_net_connect` `:allow` option, provided as regexp, matches https URIs correctly.
|
580
|
+
|
581
|
+
* `WebMock.disable_net_connect` `:allow` option can be set as a url string with scheme, host and port.
|
582
|
+
|
583
|
+
WebMock.disable_net_connect!(:allow => 'https://www.google.pl')
|
584
|
+
|
585
|
+
Thanks to [Gabriel Chaney](https://github.com/gabrieljoelc) for reporting the issue.
|
586
|
+
|
587
|
+
## 1.24.2
|
588
|
+
|
589
|
+
* Improve parsing of params on request
|
590
|
+
|
591
|
+
Thanks to [Cedric Pimenta](https://github.com/cedricpim)
|
592
|
+
|
593
|
+
## 1.24.1
|
594
|
+
|
595
|
+
* HTTPClient adapter supports reading basic authentication credentials directly from Authorization header.
|
596
|
+
|
597
|
+
Thanks to [Michiel Karnebeek](https://github.com/mkarnebeek)
|
598
|
+
|
599
|
+
## 1.24.0
|
600
|
+
|
601
|
+
* Enabled support for Curb > 0.8.6
|
602
|
+
|
603
|
+
## 1.23.0
|
604
|
+
|
605
|
+
* `WebMock.disable_net_connect` accepts `:allow` option with an object that responds to `#call`, receiving a `URI` object and returning a boolean:
|
606
|
+
|
607
|
+
|
608
|
+
blacklist = ['google.com', 'facebook.com', 'apple.com']
|
609
|
+
allowed_sites = lambda{|uri|
|
610
|
+
blacklist.none?{|site| uri.host.include?(site) }
|
611
|
+
}
|
612
|
+
WebMock.disable_net_connect!(:allow => allowed_sites)
|
613
|
+
|
614
|
+
RestClient.get('www.example.org', '/') # ===> Allowed
|
615
|
+
RestClient.get('www.facebook.com', '/') # ===> Failure
|
616
|
+
RestClient.get('apple.com', '/') # ===> Failure
|
617
|
+
|
618
|
+
Thanks to [Pablo Brasero](https://github.com/pablobm)
|
619
|
+
|
620
|
+
* Support for HTTPClient stream responses with body chunks
|
621
|
+
|
622
|
+
Thanks to [Cedric Pimenta](https://github.com/cedricpim)
|
623
|
+
|
624
|
+
|
625
|
+
## 1.22.6
|
626
|
+
|
627
|
+
* Fixes [issue](https://github.com/bblimke/webmock/issues/568) around
|
628
|
+
WebMock restricting [Addressable](https://github.com/sporkmonger/addressable)
|
629
|
+
version, based on Ruby 1.8.7 for all versions of Ruby.
|
630
|
+
|
631
|
+
This change inverts that, and forces Ruby 1.8.7 users to specify in thier
|
632
|
+
Gemfile an Addressable version < 2.4.0.
|
633
|
+
|
634
|
+
Thanks to [PikachuEXE](https://github.com/PikachuEXE) and
|
635
|
+
[Matthew Rudy Jacobs](https://github.com/matthewrudy).
|
636
|
+
|
637
|
+
## 1.22.5
|
638
|
+
|
639
|
+
* Fixes [bug](https://github.com/bblimke/webmock/issues/565) where WebMock tries
|
640
|
+
to alias a method that is deprecated in Ruby Versions > 1.9.2 ('sysread' for class 'StringIO')
|
641
|
+
|
642
|
+
Thanks to [Marcos Acosta](https://github.com/mmaa) for discovering this bug.
|
643
|
+
|
644
|
+
## 1.22.4
|
645
|
+
|
646
|
+
* Adds support for JSONClient (a subclass of HTTPClient)
|
647
|
+
|
648
|
+
Thanks to [Andrew Kozin](https://github.com/nepalez)
|
649
|
+
|
650
|
+
* Adds support for Ruby 2.3.0
|
651
|
+
|
652
|
+
Thanks to [Charles Pence](https://github.com/cpence)
|
653
|
+
|
654
|
+
* Adds support for [http](https://github.com/httprb/http) versions >= 1.0.0
|
655
|
+
|
656
|
+
Thanks to [Alexey Zapparov](https://github.com/ixti)
|
657
|
+
|
658
|
+
* Fixes support for Ruby 1.8.7 by restrciting Addressable version < 2.4.0
|
659
|
+
|
660
|
+
Thanks to [Matthew Rudy Jacobs](https://github.com/matthewrudy)
|
661
|
+
|
662
|
+
## 1.22.3
|
663
|
+
|
664
|
+
* Return "effective_url" attribute in Typhoeus::Response
|
665
|
+
|
666
|
+
Thanks to [Senya](https://github.com/cmrd-senya)
|
667
|
+
|
668
|
+
## 1.22.2
|
669
|
+
|
670
|
+
* Fix: prevents adding an extra =true to urls with parameters without values
|
671
|
+
|
672
|
+
Thanks to [David Begin](https://github.com/davidbegin)
|
673
|
+
|
674
|
+
## 1.22.1
|
675
|
+
|
676
|
+
* Adds Rack as a development dependency and removes require rack/utils in main lib.
|
677
|
+
|
678
|
+
Thanks to [Keenan Brock](https://github.com/kbrock)
|
679
|
+
|
680
|
+
## 1.22.0
|
681
|
+
|
682
|
+
All the credit for preparing this release go to [David Begin](https://github.com/davidbegin)!
|
683
|
+
|
684
|
+
* Adds [Manticore](https://github.com/cheald/manticore) support.
|
685
|
+
|
686
|
+
Thanks to [Mike Knepper](https://github.com/mikeknep), [David Abdemoulaie](https://github.com/hobodave)
|
687
|
+
|
688
|
+
* Update to Show a hash diff for requests that have stubs with a body.
|
689
|
+
|
690
|
+
Thanks to [yurivm](https://github.com/yurivm)
|
691
|
+
|
692
|
+
* Update to mirror Net::HTTP handling of headers as symbols
|
693
|
+
|
694
|
+
* Update to ignore non-comparable-values error when sorting
|
695
|
+
query values, because sorting is just a convience.
|
696
|
+
|
697
|
+
Thanks to [Magne Land](https://github.com/magneland)
|
698
|
+
|
699
|
+
* Covert Boolean values to Strings when using them to define
|
700
|
+
the body of a request.
|
701
|
+
|
702
|
+
Thanks to [Krzysztof Rygielski](https://github.com/riggy)
|
703
|
+
|
704
|
+
* Fixes WebMock's parsing Multibyte characters
|
705
|
+
|
706
|
+
Thanks to [Zhao Wen](https://github.com/VincentZhao)
|
707
|
+
|
708
|
+
* Updates to be compatible with httpclient 2.6.0
|
709
|
+
|
710
|
+
* Converts keys from symbols to strings when for QueryMapper.to_query
|
711
|
+
|
712
|
+
Thanks to [Ramon Tayag](https://github.com/ramontayag)
|
713
|
+
|
714
|
+
* Restricts http.rb version to 0.7.3 for Ruby 1.8.7
|
715
|
+
|
716
|
+
* Fixes issue emulating em-http-request's handling of multiple requests.
|
717
|
+
|
718
|
+
Thanks to [Matt Palmer](https://github.com/mpalmer)
|
719
|
+
|
720
|
+
* WebMock requires only the necessary parts of crack to avoid pulling in safe_yaml
|
721
|
+
|
722
|
+
Thanks to [Johannes Schlumberger](https://github.com/spjsschl)
|
723
|
+
|
724
|
+
## 1.21.0
|
725
|
+
|
726
|
+
* Support for http.rb >= 0.8.0
|
727
|
+
|
728
|
+
Thanks to [Zachary Anker](https://github.com/zanker), [Aleksey V. Zapparov](https://github.com/ixti)
|
729
|
+
|
730
|
+
* Support for http.rb 0.7.0
|
731
|
+
|
732
|
+
Thanks to [Mattias Putman](https://github.com/challengee)
|
733
|
+
|
734
|
+
* Added support for RSpec3-like `and_return`, `and_raise`, `and_timeout` syntax.
|
735
|
+
|
736
|
+
Thanks to [Franky Wahl](https://github.com/frankywahl)
|
737
|
+
|
738
|
+
* Restricted Curb support up to version 0.8.6. WebMock specs fail with Curb 0.8.7.
|
739
|
+
|
740
|
+
## 1.20.4
|
741
|
+
|
742
|
+
* Fixed support for `hash_including` matcher in RSpec 3
|
743
|
+
|
744
|
+
## 1.20.3
|
745
|
+
|
746
|
+
* `with` method raises error if provided without options hash and without block
|
747
|
+
|
748
|
+
* `with` and `to_return` raise an error if invoked with invalid keys in options hash.
|
749
|
+
|
750
|
+
## 1.20.2
|
751
|
+
|
752
|
+
* WebMock provides a helpful error message if an incompatible object is given as response body.
|
753
|
+
|
754
|
+
Thanks to [Mark Lorenz](https://github.com/dapplebeforedawn)
|
755
|
+
|
756
|
+
## 1.20.1
|
757
|
+
|
758
|
+
* `assert_requested` and `assert_not_requested` accept `at_least_times` and `at_most_times` options
|
759
|
+
|
760
|
+
Thanks to [Dan Buettner](https://github.com/Capncavedan)
|
761
|
+
|
762
|
+
* Silenced `instance variable undefined` warnings in Curb adapted.
|
763
|
+
|
764
|
+
Thanks to [Sven Riedel](https://github.com/sriedel)
|
765
|
+
|
766
|
+
## 1.20.0
|
767
|
+
|
768
|
+
* Add support for on_missing callback of Curb::Easy
|
769
|
+
|
770
|
+
Thanks to [Tasos Stathopoulos](https://github.com/astathopoulos)
|
771
|
+
|
772
|
+
* Add at_least_times and at_most_times matchers
|
773
|
+
|
774
|
+
Thanks to [Dan Buettner](https://github.com/Capncavedan)
|
775
|
+
|
776
|
+
## 1.19.0
|
777
|
+
|
778
|
+
* Fixed issue with Excon adapter giving warning message when redirects middleware was enabled.
|
779
|
+
|
780
|
+
Thanks to [Theo Hultberg](https://github.com/iconara) for reporting that.
|
781
|
+
|
782
|
+
* Fixed issue with `undefined method 'valid_request_keys' for Excon::Utils:Module`
|
783
|
+
|
784
|
+
Thanks to [Pablo Jairala](https://github.com/davidjairala)
|
785
|
+
|
786
|
+
* Fixed query mapper to encode `'one' => ['1','2']` as `'one[]=1&one[]=2'`.
|
787
|
+
|
788
|
+
Thanks to [Insoo Buzz Jung](https://github.com/insoul)
|
789
|
+
|
790
|
+
* Improved cookies support for em-http-request
|
791
|
+
|
792
|
+
Thanks to [Carlos Alonso Pérez](https://github.com/calonso)
|
793
|
+
|
794
|
+
* Fix HTTP Gem adapter to ensure uri attribute is set on response object.
|
795
|
+
|
796
|
+
Thanks to [Aleksey V. Zapparov](https://github.com/ixti)
|
797
|
+
|
798
|
+
* Fixed HTTPClient adapter. The response header now receives `request_method`, `request_uri`, and `request_query` transferred from request header
|
799
|
+
|
800
|
+
Thanks to [trlorenz](https://github.com/trlorenz)
|
801
|
+
|
802
|
+
* Query mapper supports nested data structures i.e. `{"first" => [{"two" => [{"three" => "four"}, "five"]}]}`
|
803
|
+
|
804
|
+
Thanks to [Alexander Simonov](https://github.com/simonoff)
|
805
|
+
|
806
|
+
* Fixed compatibility with latest versions of Excon which don't define `VALID_REQUEST_KEYS` anymore.
|
807
|
+
|
808
|
+
Thanks to [Pablo Jairala](https://github.com/davidjairala)
|
809
|
+
|
810
|
+
* Request method is always a symbol is request signatures. This fixes the issue of WebMock not matching Typhoeus requests with request method defined as string.
|
811
|
+
|
812
|
+
Thanks to [Thorbjørn Hermanse](https://github.com/thhermansen)
|
813
|
+
|
814
|
+
* Stubbing instructions which are displayed when no matching stub is found, can be disabled with `Config.instance.show_stubbing_instructions = false`
|
815
|
+
|
816
|
+
Thanks to [Mark Lorenz](https://github.com/dapplebeforedawn)
|
817
|
+
|
818
|
+
* Notation used for mapping query strings to data structure can be configured i.e. `WebMock::Config.instance.query_values_notation = :subscript`. This allows setting `:flat_array` notation which supports duplicated parameter names in query string.
|
819
|
+
|
820
|
+
Thanks to [tjsousa](https://github.com/tjsousa)
|
821
|
+
|
822
|
+
## 1.18.0
|
823
|
+
|
824
|
+
* Updated dependency on Addressable to versions >= 2.3.6
|
825
|
+
|
826
|
+
* Added support for matching uris using RFC 6570 (URI Templates)
|
827
|
+
|
828
|
+
uri_template = Addressable::Template.new "www.example.com/{id}/"
|
829
|
+
stub_request(:any, uri_template)
|
830
|
+
|
831
|
+
Thanks to [Max Lincoln](https://github.com/maxlinc)
|
832
|
+
|
833
|
+
* Fixed content length calculation for Rack responses with UTF8 body
|
834
|
+
|
835
|
+
Thanks to [Oleg Gritsenko](https://github.com/Claster)
|
836
|
+
|
837
|
+
* Add missing Curl::Easy aliases
|
838
|
+
|
839
|
+
Thanks to [Hwan-Joon Choi](https://github.com/hc5duke)
|
840
|
+
|
841
|
+
* HTTP Gem >= 0.6.0 compatibility
|
842
|
+
|
843
|
+
Thanks to [Aleksey V. Zapparov](https://github.com/ixti)
|
844
|
+
|
845
|
+
* Minitest 4 and 5 compatibility.
|
846
|
+
|
847
|
+
Thanks to [SHIBATA Hiroshi](https://github.com/hsbt)
|
848
|
+
|
849
|
+
## 1.17.4
|
850
|
+
|
851
|
+
* Update matchers for RSpec 3's matcher protocol
|
852
|
+
|
853
|
+
Thanks to [Rob Olson](https://github.com/robolson)
|
854
|
+
|
855
|
+
## 1.17.3
|
856
|
+
|
857
|
+
* Fixed issue with Rack response removing 'Content-Type' header
|
858
|
+
|
859
|
+
Thanks to [Bo Jeanes](https://github.com/bjeanes) and [Matthew Conway](https://github.com/mattonrails)
|
860
|
+
|
861
|
+
## 1.17.2
|
862
|
+
|
863
|
+
* Support for chunked responses in Curb
|
864
|
+
|
865
|
+
Thanks to [Zachary Belzer](https://github.com/zbelzer)
|
866
|
+
|
867
|
+
* Fixed handling of request body passed as a hash to `Typhoeus.post`
|
868
|
+
|
869
|
+
Thanks to [Mason Chang](https://github.com/changmason) for reporting.
|
870
|
+
|
871
|
+
## 1.17.1
|
872
|
+
|
873
|
+
* Added missing license statements.
|
874
|
+
|
875
|
+
Thanks to [Praveen Arimbrathodiyil](https://github.com/pravi)
|
876
|
+
|
877
|
+
## 1.17.0
|
878
|
+
|
879
|
+
* HTTP gem support!
|
880
|
+
|
881
|
+
Thanks to [Aleksey V. Zapparov](https://github.com/ixti)
|
882
|
+
|
883
|
+
* Limited Excon gem requirement to version < 0.30 until the compatibility with version > 0.30.0 is fixed.
|
884
|
+
|
885
|
+
Thanks to [Aleksey V. Zapparov](https://github.com/ixti)
|
886
|
+
|
887
|
+
* Fixed issue where empty query key caused a `TypeError`
|
888
|
+
|
889
|
+
Thanks to [Jon Rowe](https://github.com/JonRowe)
|
890
|
+
|
891
|
+
* Handling Typhoeus `on_headers` and `on_body` params.
|
892
|
+
|
893
|
+
Thanks to [Matt Burke](https://github.com/spraints)
|
894
|
+
|
895
|
+
## 1.16.1
|
896
|
+
|
897
|
+
* Fixed "NameError: uninitialized constant WebMock::Response::Pathname" issue.
|
898
|
+
|
899
|
+
Thanks to [Alex Stupakow and Karen Wang](https://github.com/stupakov) for the fix.
|
900
|
+
|
901
|
+
## 1.16.0
|
902
|
+
|
903
|
+
* Allow a Pathname to be passed as a Response body
|
904
|
+
|
905
|
+
stub_request(:get, /example.com/).to_return(
|
906
|
+
body: Rails.root.join('test/fixtures/foo.txt')
|
907
|
+
)
|
908
|
+
|
909
|
+
Thanks to [Ben Pickles](https://github.com/benpickles)
|
910
|
+
|
911
|
+
* `hash_including` matcher can be initialized with empty keys to match any values.
|
912
|
+
|
913
|
+
stub_request(:post, "www.example.com").with(:body => hash_including(:a, :b => {'c'}))
|
914
|
+
RestClient.post('www.example.com', '{"a":"1","b":"c"}', :content_type => 'application/json')
|
915
|
+
|
916
|
+
Thanks to [Stefano Uliari](https://github.com/steookk)
|
917
|
+
|
918
|
+
## 1.15.2
|
919
|
+
|
920
|
+
* Fixed `hash_including` to accept a splat of solitary keys.
|
921
|
+
|
922
|
+
Thanks to [Tamir Duberstein](https://github.com/tamird) and [https://github.com/strongriley](https://github.com/strongriley)
|
923
|
+
|
924
|
+
## 1.15.0
|
925
|
+
|
926
|
+
* Excon >= 0.27.5 compatibility.
|
927
|
+
|
928
|
+
Thanks to [Brian D. Burns](https://github.com/burns)
|
929
|
+
|
930
|
+
## 1.14.0
|
931
|
+
|
932
|
+
* Handling non UTF-8 characters in query params.
|
933
|
+
|
934
|
+
Thanks to [Florian Dütsch](https://github.com/der-flo) for reporting the issue.
|
935
|
+
|
936
|
+
* Added support for `request_block` param in Excon
|
937
|
+
|
938
|
+
Thanks to [Dmitry Gutov](https://github.com/dgutov) for reporting the issue.
|
939
|
+
|
940
|
+
* Fixed compatibility with latest Curb
|
941
|
+
|
942
|
+
Thanks to [Ian Lesperance](https://github.com/elliterate) and [Matthew Horan](https://github.com/mhoran)
|
943
|
+
|
944
|
+
* Triggering errbacks assynchronously in em-http-request adapter.
|
945
|
+
|
946
|
+
Thanks to [Ian Lesperance](https://github.com/elliterate) and [Matthew Horan](https://github.com/mhoran)
|
947
|
+
|
948
|
+
* Handling query params with a hashes nested inside arrays.
|
949
|
+
|
950
|
+
Thanks to [Ian Asaff](https://github.com/montague)
|
951
|
+
|
952
|
+
* Changed NetConnectNotAllowedError to inherit from Exception to allow it to bubble up into a test suite.
|
953
|
+
|
954
|
+
Thanks to [Daniel van Hoesel](https://github.com/s0meone)
|
955
|
+
|
956
|
+
* HTTPClient adapter is thread safe.
|
957
|
+
|
958
|
+
Thanks to [Tom Beauvais](https://github.com/tbeauvais)
|
959
|
+
|
960
|
+
## 1.13.0
|
961
|
+
|
962
|
+
* Net::HTTP::Persistent compatibility.
|
963
|
+
WebMock doesn't disconnect previously started connections upon a request anymore.
|
964
|
+
|
965
|
+
|
966
|
+
## 1.12.3
|
967
|
+
|
968
|
+
* Fixed issue with handling Addressable::URI with query params passed to `Net::HTTP.get_response`
|
969
|
+
|
970
|
+
Thanks to [Leif Bladt](https://github.com/leifbladt)
|
971
|
+
|
972
|
+
* Fixed HTTPClient adapter to not raise an error if a request with multipart body is executed.
|
973
|
+
|
974
|
+
## 1.12.2
|
975
|
+
|
976
|
+
* Fixed issue with handling request.path when Addressable::URI is passed to #request instead of URI with Ruby 2.0.
|
977
|
+
|
978
|
+
Thanks to [Leif Bladt](https://github.com/leifbladt)
|
979
|
+
|
980
|
+
* Accept integers as query param values in request stubs
|
981
|
+
|
982
|
+
i.e. `stub_request(:get, /.*/).with(:query => {"a" => 1})`
|
983
|
+
|
984
|
+
Thanks to [Mitsutaka Mimura](https://github.com/takkanm)
|
985
|
+
|
986
|
+
## 1.12.1
|
987
|
+
|
988
|
+
* Fixed Minitest < 5.0 compatibility
|
989
|
+
|
990
|
+
Thanks to [Alex Tomlins](https://github.com/alext) for reporting the issue.
|
991
|
+
|
992
|
+
## 1.12.0
|
993
|
+
|
994
|
+
* Not using Gem spec anymore to check loaded Curb version.
|
995
|
+
|
996
|
+
* `WebMock.disable_net_connect!` now accepts array of regexps as allow param:
|
997
|
+
|
998
|
+
i.e. `WebMock.disable_net_connect!(:allow => [/google.com/, /yahoo.com/])`
|
999
|
+
|
1000
|
+
Thanks to [Bastien Vaucher](https://github.com/bastien)
|
1001
|
+
|
1002
|
+
* Fixed `on_header` Curb callback behaviour in Curb adapter
|
1003
|
+
|
1004
|
+
Thanks to [Joel Chippindale](https://github.com/mocoso)
|
1005
|
+
|
1006
|
+
* Fixed aws-sdk compatibility with Ruby 2.0, by supporting `continue_timeout` accessor on Net::HTTP socket.
|
1007
|
+
|
1008
|
+
Thanks to [Lin Jen-Shin](https://github.com/godfat)
|
1009
|
+
|
1010
|
+
* Fixed WebMock::Server to not give "log writing failed. can't be called from trap context" warning with Ruby 2.0
|
1011
|
+
|
1012
|
+
Thanks to [Murahashi Sanemat Kenichi](https://github.com/sanemat)
|
1013
|
+
|
1014
|
+
* Added support for EM-HTTP-Request streaming data off disk feature.
|
1015
|
+
|
1016
|
+
Thanks to [Lin Jen-Shin](https://github.com/godfat)
|
1017
|
+
|
1018
|
+
* Added compatibility with Minitest 5
|
1019
|
+
|
1020
|
+
Thanks to [Tim Kurvers](https://github.com/timkurvers)
|
1021
|
+
|
1022
|
+
* Excon >= 0.22 compatibility.
|
1023
|
+
|
1024
|
+
* README has nice sytnax hightlighting and fixed code styling!
|
1025
|
+
|
1026
|
+
Thanks to [Ilya Vassilevsky](https://github.com/vassilevsky)
|
1027
|
+
|
1028
|
+
* Compatibility with Rails 4 `rack.session.options`
|
1029
|
+
|
1030
|
+
Thanks to [gotwalt](https://github.com/gotwalt)
|
1031
|
+
|
1032
|
+
## 1.11.0
|
1033
|
+
|
1034
|
+
* Excon >= 0.17 support.
|
1035
|
+
|
1036
|
+
Thanks to [Nathan Sutton](https://github.com/nate) for reporting this issue and to [Wesley Beary](https://github.com/geemus) and [Myron Marston](https://github.com/myronmarston) for help.
|
1037
|
+
|
1038
|
+
## 1.10.2
|
1039
|
+
|
1040
|
+
* '+' in request path is treated as plus, but in query params always as a space.
|
1041
|
+
|
1042
|
+
## 1.10.1
|
1043
|
+
|
1044
|
+
* '+' in request body is still treated as a space. This fixes a bug introduced in previous version.
|
1045
|
+
|
1046
|
+
Thanks to [Erik Michaels-Ober](https://github.com/sferik) for reporting this problem.
|
1047
|
+
|
1048
|
+
* Fixed issue: response body declared as Proc was not evaluated again on subsequent requests.
|
1049
|
+
|
1050
|
+
Thanks to [Rick Fletcher](https://github.com/rfletcher) for reporting this issue.
|
1051
|
+
|
1052
|
+
## 1.10.0
|
1053
|
+
|
1054
|
+
* '+' in query params is not treated as space anymore and is encoded as %2B
|
1055
|
+
|
1056
|
+
Thanks to [goblin](https://github.com/goblin) for reporting this issue.
|
1057
|
+
|
1058
|
+
* added `remove_request_stub` method to the api to allow removing unused stubs i.e.
|
1059
|
+
|
1060
|
+
stub_get = stub_request(:get, "www.example.com")
|
1061
|
+
remove_request_stub(stub_get)
|
1062
|
+
|
1063
|
+
* `assert_requested` and `assert_not_requested` raise an error if a stub object is provided together with a block.
|
1064
|
+
|
1065
|
+
## 1.9.3
|
1066
|
+
|
1067
|
+
* Fixed issue with unavailable constant Mutex in Ruby < 1.9
|
1068
|
+
|
1069
|
+
Thanks to [Lucas Dohmen](https://github.com/moonglum) for reporting this issue.
|
1070
|
+
|
1071
|
+
## 1.9.2
|
1072
|
+
|
1073
|
+
* Added support for Excon's :response_block parameter
|
1074
|
+
|
1075
|
+
Thanks to [Myron Marston](https://github.com/myronmarston) for reporting this issue.
|
1076
|
+
|
1077
|
+
## 1.9.1
|
1078
|
+
|
1079
|
+
* Fix 'rack.errors' not being set for Rack apps
|
1080
|
+
|
1081
|
+
Thanks to [Alex Grant](https://github.com/grantovich)
|
1082
|
+
|
1083
|
+
* Added support for minitest assertions count
|
1084
|
+
|
1085
|
+
Thanks to [Mokevnin Kirill](https://github.com/mokevnin)
|
1086
|
+
|
1087
|
+
* Fixed issues with registering http requests in multi-threaded environments
|
1088
|
+
|
1089
|
+
Thanks to [Tom Beauvais](https://github.com/tbeauvais)
|
1090
|
+
|
1091
|
+
* Bumped Crack version to >=0.3.2
|
1092
|
+
|
1093
|
+
Thanks to [Jake Benilov](https://github.com/benilovj)
|
1094
|
+
|
1095
|
+
* Fixed issues in Typhoeus 0.6. Defaulted method to GET when no method specified.
|
1096
|
+
|
1097
|
+
Thanks to [Hans Hasselberg](https://github.com/i0rek)
|
1098
|
+
|
1099
|
+
* Add license information to the gemspec
|
1100
|
+
|
1101
|
+
Thanks to [Jordi Massaguer Pla](https://github.com/jordimassaguerpla) and [Murahashi Sanemat Kenichi](https://github.com/sanemat)
|
1102
|
+
|
1103
|
+
* Added support for :expects option in Excon adapter
|
1104
|
+
|
1105
|
+
Thanks to [Evgeniy Dolzhenko](https://github.com/dolzenko)
|
1106
|
+
|
1107
|
+
* Fixed Faye compatibility by treating StringIO in Net::HTTP adapter properly
|
1108
|
+
|
1109
|
+
Thanks to [Pavel Forkert](https://github.com/fxposter)
|
1110
|
+
|
1111
|
+
* Updated VCR link
|
1112
|
+
|
1113
|
+
Thanks to [Rex Feng](https://github.com/xta)
|
1114
|
+
|
1115
|
+
## 1.9.0
|
1116
|
+
|
1117
|
+
* Added support for Typhoeus >= 0.5.0 and removed support for Typhoeus < 0.5.0.
|
1118
|
+
|
1119
|
+
Thanks to [Hans Hasselberg](https://github.com/i0rek)
|
1120
|
+
|
1121
|
+
## 1.8.11
|
1122
|
+
|
1123
|
+
* Fix excon adapter to handle `:body => some_file_object`
|
1124
|
+
|
1125
|
+
Thanks to [Myron Marston](https://github.com/myronmarston)
|
1126
|
+
|
1127
|
+
## 1.8.10
|
1128
|
+
|
1129
|
+
* em-http-request fix. After request callbacks are correctly invoked for 3xx responses,
|
1130
|
+
when :redirects option is set.
|
1131
|
+
|
1132
|
+
Thanks to [Myron Marston](https://github.com/myronmarston) for reporting that issue.
|
1133
|
+
|
1134
|
+
* Fixed compatibility with Net::HTTP::DigestAuth
|
1135
|
+
|
1136
|
+
Thanks to [Jonathan Hyman](https://github.com/jonhyman) for reporting that issue.
|
1137
|
+
|
1138
|
+
* Fixed problem in em-http-request 0.x appending the query to the client URI twice.
|
1139
|
+
|
1140
|
+
Thanks to [Paweł Pierzchała](https://github.com/wrozka)
|
1141
|
+
|
1142
|
+
## 1.8.9
|
1143
|
+
|
1144
|
+
* Fixed problem with caching nil responses when the same HTTPClient instance is used.
|
1145
|
+
|
1146
|
+
Thanks to [Myron Marston](https://github.com/myronmarston)
|
1147
|
+
|
1148
|
+
* Added support for Addressable >= 2.3.0. Addressable 2.3.0 removed support for multiple query value notations and broke backwards compatibility.
|
1149
|
+
|
1150
|
+
https://github.com/sporkmonger/addressable/commit/f51e290b5f68a98293327a7da84eb9e2d5f21c62
|
1151
|
+
https://github.com/sporkmonger/addressable/issues/77
|
1152
|
+
|
1153
|
+
|
1154
|
+
## 1.8.8
|
1155
|
+
|
1156
|
+
* Fixed Net::HTTP adapter so that it returns `nil` for an empty body response.
|
1157
|
+
|
1158
|
+
Thanks to [Myron Marston](https://github.com/myronmarston)
|
1159
|
+
|
1160
|
+
* Gemspec defines compatibility with Addressable ~> 2.2.8, not >= 2.3.0
|
1161
|
+
|
1162
|
+
* Specs compatibility with Typhoeus 0.4.0
|
1163
|
+
|
1164
|
+
Thanks to [Hans Hasselberg](https://github.com/i0rek)
|
1165
|
+
|
1166
|
+
* Handling content types that specify a charset
|
1167
|
+
|
1168
|
+
Thanks to [Kevin Glowacz](https://github.com/kjg)
|
1169
|
+
|
1170
|
+
* Fixed em-http-request adapter to correctly fetch authorization header from a request
|
1171
|
+
|
1172
|
+
Thanks to [Julien Boyer](https://github.com/chatgris)
|
1173
|
+
|
1174
|
+
* Fixing travis-ci image to report master's status
|
1175
|
+
|
1176
|
+
Thanks to [Ryan Schlesinger](https://github.com/ryansch)
|
1177
|
+
|
1178
|
+
* Fixed problem with em-http-request callback triggering if there were other EM::Deferred callbacks registered
|
1179
|
+
|
1180
|
+
Thanks to [Jon Leighton](https://github.com/jonleighton)
|
1181
|
+
|
1182
|
+
* Fixed problem with em-http-request appending the query to the URI a second time, and
|
1183
|
+
the parameters are repeated.
|
1184
|
+
|
1185
|
+
Thanks to [Jon Leighton](https://github.com/jonleighton)
|
1186
|
+
|
1187
|
+
## 1.8.7
|
1188
|
+
|
1189
|
+
* Compatibility with RSpec >= 2.10
|
1190
|
+
|
1191
|
+
Thanks to [erwanlr](https://github.com/erwanlr) for reporting this issue.
|
1192
|
+
|
1193
|
+
* Add missing required rack environment variable SCRIPT_NAME
|
1194
|
+
|
1195
|
+
Thanks to [Eric Oestrich](https://github.com/oestrich)
|
1196
|
+
|
1197
|
+
* Fixed warnings due to @query_params not being initialized
|
1198
|
+
|
1199
|
+
Thanks to [Ben Bleything](https://github.com/bleything)
|
1200
|
+
|
3
1201
|
## 1.8.6
|
4
1202
|
|
5
1203
|
* Pass through SERVER_PORT when stubbing to rack
|