webmock 3.5.0 → 3.25.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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +476 -2
- data/README.md +166 -42
- data/lib/webmock/api.rb +2 -0
- data/lib/webmock/assertion_failure.rb +2 -0
- data/lib/webmock/callback_registry.rb +2 -0
- data/lib/webmock/config.rb +2 -0
- data/lib/webmock/cucumber.rb +2 -0
- data/lib/webmock/deprecation.rb +2 -0
- data/lib/webmock/errors.rb +2 -0
- data/lib/webmock/http_lib_adapters/async_http_client_adapter.rb +228 -0
- data/lib/webmock/http_lib_adapters/curb_adapter.rb +14 -3
- data/lib/webmock/http_lib_adapters/em_http_request_adapter.rb +22 -9
- data/lib/webmock/http_lib_adapters/excon_adapter.rb +5 -0
- data/lib/webmock/http_lib_adapters/http_lib_adapter.rb +2 -0
- data/lib/webmock/http_lib_adapters/http_lib_adapter_registry.rb +2 -0
- data/lib/webmock/http_lib_adapters/http_rb/client.rb +4 -1
- data/lib/webmock/http_lib_adapters/http_rb/request.rb +17 -5
- data/lib/webmock/http_lib_adapters/http_rb/response.rb +49 -5
- data/lib/webmock/http_lib_adapters/http_rb/streamer.rb +11 -3
- data/lib/webmock/http_lib_adapters/http_rb/webmock.rb +8 -2
- data/lib/webmock/http_lib_adapters/http_rb_adapter.rb +7 -5
- data/lib/webmock/http_lib_adapters/httpclient_adapter.rb +25 -7
- data/lib/webmock/http_lib_adapters/manticore_adapter.rb +35 -15
- data/lib/webmock/http_lib_adapters/net_http.rb +59 -112
- data/lib/webmock/http_lib_adapters/net_http_response.rb +3 -1
- data/lib/webmock/http_lib_adapters/patron_adapter.rb +4 -2
- data/lib/webmock/http_lib_adapters/typhoeus_hydra_adapter.rb +18 -2
- data/lib/webmock/matchers/any_arg_matcher.rb +2 -0
- data/lib/webmock/matchers/hash_argument_matcher.rb +2 -0
- data/lib/webmock/matchers/hash_excluding_matcher.rb +2 -0
- data/lib/webmock/matchers/hash_including_matcher.rb +2 -0
- data/lib/webmock/minitest.rb +2 -0
- data/lib/webmock/rack_response.rb +5 -1
- data/lib/webmock/request_body_diff.rb +3 -1
- data/lib/webmock/request_execution_verifier.rb +2 -0
- data/lib/webmock/request_pattern.rb +118 -61
- data/lib/webmock/request_registry.rb +2 -0
- data/lib/webmock/request_signature.rb +4 -2
- data/lib/webmock/request_signature_snippet.rb +2 -0
- data/lib/webmock/request_stub.rb +34 -0
- data/lib/webmock/response.rb +22 -14
- data/lib/webmock/responses_sequence.rb +2 -0
- data/lib/webmock/rspec/matchers/request_pattern_matcher.rb +2 -0
- data/lib/webmock/rspec/matchers/webmock_matcher.rb +2 -0
- data/lib/webmock/rspec/matchers.rb +2 -0
- data/lib/webmock/rspec.rb +4 -1
- data/lib/webmock/stub_registry.rb +28 -11
- data/lib/webmock/stub_request_snippet.rb +2 -0
- data/lib/webmock/test_unit.rb +3 -3
- data/lib/webmock/util/hash_counter.rb +12 -6
- data/lib/webmock/util/hash_keys_stringifier.rb +2 -0
- data/lib/webmock/util/hash_validator.rb +2 -0
- data/lib/webmock/util/headers.rb +23 -10
- data/lib/webmock/util/parsers/json.rb +72 -0
- data/lib/webmock/util/parsers/parse_error.rb +7 -0
- data/lib/webmock/util/parsers/xml.rb +16 -0
- data/lib/webmock/util/query_mapper.rb +6 -2
- data/lib/webmock/util/uri.rb +11 -9
- data/lib/webmock/util/values_stringifier.rb +2 -0
- data/lib/webmock/util/version_checker.rb +7 -5
- data/lib/webmock/version.rb +3 -1
- data/lib/webmock/webmock.rb +22 -3
- data/lib/webmock.rb +5 -2
- metadata +99 -175
- data/.gemtest +0 -0
- data/.gitignore +0 -34
- data/.rspec-tm +0 -2
- data/.travis.yml +0 -21
- data/Gemfile +0 -9
- data/Rakefile +0 -30
- data/lib/webmock/util/json.rb +0 -67
- data/minitest/test_helper.rb +0 -34
- data/minitest/test_webmock.rb +0 -9
- data/minitest/webmock_spec.rb +0 -60
- data/spec/acceptance/curb/curb_spec.rb +0 -481
- data/spec/acceptance/curb/curb_spec_helper.rb +0 -147
- data/spec/acceptance/em_http_request/em_http_request_spec.rb +0 -406
- data/spec/acceptance/em_http_request/em_http_request_spec_helper.rb +0 -77
- data/spec/acceptance/excon/excon_spec.rb +0 -77
- data/spec/acceptance/excon/excon_spec_helper.rb +0 -50
- data/spec/acceptance/http_rb/http_rb_spec.rb +0 -82
- data/spec/acceptance/http_rb/http_rb_spec_helper.rb +0 -54
- data/spec/acceptance/httpclient/httpclient_spec.rb +0 -217
- data/spec/acceptance/httpclient/httpclient_spec_helper.rb +0 -57
- data/spec/acceptance/manticore/manticore_spec.rb +0 -56
- data/spec/acceptance/manticore/manticore_spec_helper.rb +0 -35
- data/spec/acceptance/net_http/net_http_shared.rb +0 -153
- data/spec/acceptance/net_http/net_http_spec.rb +0 -331
- data/spec/acceptance/net_http/net_http_spec_helper.rb +0 -64
- data/spec/acceptance/net_http/real_net_http_spec.rb +0 -20
- data/spec/acceptance/patron/patron_spec.rb +0 -125
- data/spec/acceptance/patron/patron_spec_helper.rb +0 -54
- data/spec/acceptance/shared/allowing_and_disabling_net_connect.rb +0 -313
- data/spec/acceptance/shared/callbacks.rb +0 -147
- data/spec/acceptance/shared/complex_cross_concern_behaviors.rb +0 -36
- data/spec/acceptance/shared/enabling_and_disabling_webmock.rb +0 -95
- data/spec/acceptance/shared/precedence_of_stubs.rb +0 -15
- data/spec/acceptance/shared/request_expectations.rb +0 -923
- data/spec/acceptance/shared/returning_declared_responses.rb +0 -388
- data/spec/acceptance/shared/stubbing_requests.rb +0 -638
- data/spec/acceptance/typhoeus/typhoeus_hydra_spec.rb +0 -135
- data/spec/acceptance/typhoeus/typhoeus_hydra_spec_helper.rb +0 -60
- data/spec/acceptance/webmock_shared.rb +0 -41
- data/spec/fixtures/test.txt +0 -1
- data/spec/quality_spec.rb +0 -84
- data/spec/spec_helper.rb +0 -48
- data/spec/support/example_curl_output.txt +0 -22
- data/spec/support/failures.rb +0 -9
- data/spec/support/my_rack_app.rb +0 -53
- data/spec/support/network_connection.rb +0 -19
- data/spec/support/webmock_server.rb +0 -69
- data/spec/unit/api_spec.rb +0 -175
- data/spec/unit/errors_spec.rb +0 -129
- data/spec/unit/http_lib_adapters/http_lib_adapter_registry_spec.rb +0 -17
- data/spec/unit/http_lib_adapters/http_lib_adapter_spec.rb +0 -12
- data/spec/unit/matchers/hash_excluding_matcher_spec.rb +0 -61
- data/spec/unit/matchers/hash_including_matcher_spec.rb +0 -87
- data/spec/unit/rack_response_spec.rb +0 -112
- data/spec/unit/request_body_diff_spec.rb +0 -90
- data/spec/unit/request_execution_verifier_spec.rb +0 -208
- data/spec/unit/request_pattern_spec.rb +0 -596
- data/spec/unit/request_registry_spec.rb +0 -95
- data/spec/unit/request_signature_snippet_spec.rb +0 -89
- data/spec/unit/request_signature_spec.rb +0 -155
- data/spec/unit/request_stub_spec.rb +0 -199
- data/spec/unit/response_spec.rb +0 -282
- data/spec/unit/stub_registry_spec.rb +0 -103
- data/spec/unit/stub_request_snippet_spec.rb +0 -115
- data/spec/unit/util/hash_counter_spec.rb +0 -39
- data/spec/unit/util/hash_keys_stringifier_spec.rb +0 -27
- data/spec/unit/util/headers_spec.rb +0 -28
- data/spec/unit/util/json_spec.rb +0 -33
- data/spec/unit/util/query_mapper_spec.rb +0 -150
- data/spec/unit/util/uri_spec.rb +0 -299
- data/spec/unit/util/version_checker_spec.rb +0 -65
- data/spec/unit/webmock_spec.rb +0 -11
- data/test/http_request.rb +0 -24
- data/test/shared_test.rb +0 -108
- data/test/test_helper.rb +0 -23
- data/test/test_webmock.rb +0 -6
- data/webmock.gemspec +0 -46
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a71743bb6d5f304d032ba24c918ac45b07426f28b170068c5fbd5c7c0757fcb6
|
4
|
+
data.tar.gz: ad25d2f20543df2419e74378c2f072824347d37587a7a8fd00dccca40aaa07e5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 00f2b6475d6845de134311b47cd545c674b750f6b270579bc3124664f40ce60d7b56b26c531d0e968d72fa53d1c902f105d7e52d274330336c30c504cbcd83e3
|
7
|
+
data.tar.gz: 163df74a3e2c219ee42c8d591acd9042e605427433129a7c421dc4d25671ca8073757409fb105740601add8284d52b2a464ed59500829dc9a97eeceb99b2545c
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,479 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
+
# 3.25.0
|
4
|
+
|
5
|
+
* Resolve net-http adapter deprecation Ruby 3.4
|
6
|
+
|
7
|
+
Thanks to [Earlopain](https://github.com/Earlopain)
|
8
|
+
|
9
|
+
# 3.24.0
|
10
|
+
|
11
|
+
* Ignore parsing errors when parsing invalid JSON or XML body to match against body pattern #1066
|
12
|
+
|
13
|
+
Thanks to [Christian Schmidt](https://github.com/c960657)
|
14
|
+
|
15
|
+
* Added support for mocked HTTP::Connection#finished_request? method #1065
|
16
|
+
|
17
|
+
Thanks to [Christian Schmidt](https://github.com/c960657)
|
18
|
+
|
19
|
+
* Detect if Patron is loaded by checking if Patron::Session constant is defined #1068
|
20
|
+
|
21
|
+
Thanks to [Rodrigo Argumedo](https://github.com/rodrigoargumedo)
|
22
|
+
|
23
|
+
* Raising an ArgumentError when uri is passed as a Pathname object to stub_request or request expectation declaration.
|
24
|
+
|
25
|
+
* Dropped support for em-http-request on Ruby 3.4. The current version of em-http-request (1.1.7) is incompatible with Ruby 3.4 due to an unresolved issue (https://github.com/igrigorik/em-http-request/issues/365). Support for em-http-request will be re-enabled once the compatibility issue is resolved.
|
26
|
+
|
27
|
+
Thanks to [Christian Schmidt](https://github.com/c960657)
|
28
|
+
|
29
|
+
# 3.23.1
|
30
|
+
|
31
|
+
* Added support for async-http version >= 0.65.0 [PR](https://github.com/bblimke/webmock/pull/1056)
|
32
|
+
|
33
|
+
Thanks to [Jacob Frautschi](https://github.com/jakeonfire)
|
34
|
+
|
35
|
+
# 3.23.0
|
36
|
+
|
37
|
+
* Fixed HTTP.rb adapter to support streaming real responses when WebMock is enabled.
|
38
|
+
|
39
|
+
Thanks to [Viacheslav Nepomniashchikh](https://github.com/aka-nez) for reporting and investigating this [issue](https://github.com/bblimke/webmock/issues/1017).
|
40
|
+
|
41
|
+
# 3.22.0
|
42
|
+
|
43
|
+
* Addressed an issue in the HTTPClient adapter where memoized stubbed responses and memoized request_signatures were incorrectly persisted between subsequent requests ([#1019](https://github.com/bblimke/webmock/issues/1019)). The implementation of a more robust thread-safety solution by [Tom Beauvais](https://github.com/tbeauvais) in [PR #300](https://github.com/bblimke/webmock/pull/300) not only resolved the memoization problem but also enhanced the overall thread safety of the adapter. This update ensures that stubbed responses and request signatures are correctly isolated to individual requests, improving both consistency and thread safety.
|
44
|
+
|
45
|
+
# 3.21.2
|
46
|
+
|
47
|
+
* Corrected type checking in `WebMock::Response#assert_valid_body!` to accurately recognize `Hash` objects. Additionally, improved the clarity of the error message for unsupported body types, guiding users towards proper usage.
|
48
|
+
|
49
|
+
Thanks to [Jake Robb](https://github.com/jakerobb) for reporting.
|
50
|
+
|
51
|
+
# 3.21.1
|
52
|
+
|
53
|
+
* The stubbed Net::HTTPResponse#uri now returns request.uri, aligning it with the behavior of an actual Net::HTTPResponse.
|
54
|
+
|
55
|
+
Thanks to [Abe Voelker](https://github.com/abevoelker) for reporting and to [Victor Maslov](https://github.com/Nakilon) and [Gio Lodi](https://github.com/mokagio) for the suggested solution.
|
56
|
+
|
57
|
+
# 3.21.0
|
58
|
+
|
59
|
+
* Don't use deprecated Rack::VERSION for Rack >= 3
|
60
|
+
|
61
|
+
Thanks to [Étienne Barrié](https://github.com/etiennebarrie)
|
62
|
+
|
63
|
+
* Updated HTTPClient adapter, to build request signature using the URI after filters have been applied.
|
64
|
+
|
65
|
+
Thanks to [Matt Brown](https://github.com/mattbnz)
|
66
|
+
|
67
|
+
# 3.20.0
|
68
|
+
|
69
|
+
* Optimised EmHttpRequestAdapter performance.
|
70
|
+
|
71
|
+
Thanks to [Ricardo Trindade](https://github.com/RicardoTrindade)
|
72
|
+
|
73
|
+
* Removed runtime dependency on base64.
|
74
|
+
|
75
|
+
Thanks to [Earlopain](https://github.com/Earlopain)
|
76
|
+
|
77
|
+
* Typhoeus::Response objects constructed from stubbed responses now have all timing attributes set to 0.0.
|
78
|
+
|
79
|
+
Thanks to [James Brown](https://github.com/Roguelazer)
|
80
|
+
|
81
|
+
* Optimised WebMock::Util::Headers by removing redundant freeze invocations.
|
82
|
+
|
83
|
+
Thanks to [Kazuhiro NISHIYAMA](https://github.com/znz)
|
84
|
+
|
85
|
+
* The default stubbed response body, which is an empty String, is unfrozen.
|
86
|
+
|
87
|
+
* When building signatures of requests made by http.rb, the request body encoding is now preserved.
|
88
|
+
|
89
|
+
# 3.19.1
|
90
|
+
|
91
|
+
* 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.
|
92
|
+
|
93
|
+
Thanks to [Jason Karns](https://github.com/jasonkarns) for reporting.
|
94
|
+
|
95
|
+
# 3.19.0
|
96
|
+
|
97
|
+
* Do not alter real (non-stubbed) request headers when handling em-http-request requests.
|
98
|
+
|
99
|
+
Thanks to [Yoann Lecuyer](https://github.com/ylecuyer)
|
100
|
+
|
101
|
+
* Fix matching stubs with HashExcludingMatcher
|
102
|
+
|
103
|
+
Thanks to [Lucas Arnaud](https://github.com/lucasarnaud)
|
104
|
+
|
105
|
+
* Remove development and test files from the gem package
|
106
|
+
|
107
|
+
Thanks to [Orien Madgwick](https://github.com/orien)
|
108
|
+
|
109
|
+
* Fix supported http client gem version checks.
|
110
|
+
|
111
|
+
Thanks to [Marc Rohloff](https://github.com/marcrohloff) and [Roman Stražanec](https://github.com/romanstrazanec)
|
112
|
+
|
113
|
+
* Non-string body passed to #to_return_json is now converted to JSON string.
|
114
|
+
|
115
|
+
Thanks to [inkstak](https://github.com/inkstak)
|
116
|
+
|
117
|
+
* `[::1]` is recognised as localhost e.g when passing `allow_localhost` option to `disable_net_connect!`
|
118
|
+
|
119
|
+
Thanks to [Yuki Inoue](https://github.com/Yuki-Inoue)
|
120
|
+
|
121
|
+
* Optimized `normalize_headers` for performance
|
122
|
+
|
123
|
+
Thanks to [Brandon Weaver](https://github.com/baweaver)
|
124
|
+
|
125
|
+
* Added Frozen string literal to files to optimise memory usage
|
126
|
+
|
127
|
+
Thanks to [Josh Nichols](https://github.com/technicalpickles)
|
128
|
+
|
129
|
+
# 3.18.1
|
130
|
+
|
131
|
+
* Reverted simplified connection handing in Net::HTTP adapter due to https://github.com/bblimke/webmock/issues/999
|
132
|
+
|
133
|
+
# 3.18.0
|
134
|
+
|
135
|
+
* Net::BufferedIO is not replaced anymore.
|
136
|
+
|
137
|
+
Thanks to [Ray Zane](https://github.com/rzane)
|
138
|
+
|
139
|
+
* Simplified connection handing in Net::HTTP adapter.
|
140
|
+
|
141
|
+
Thanks to [Ray Zane](https://github.com/rzane)
|
142
|
+
|
143
|
+
# 3.17.1
|
144
|
+
|
145
|
+
* Fixed Syntax Error
|
146
|
+
|
147
|
+
Thanks to [Mark Spangler](https://github.com/mspangler)
|
148
|
+
|
149
|
+
# 3.17.0
|
150
|
+
|
151
|
+
* Minimum required Ruby version is 2.3
|
152
|
+
|
153
|
+
Thanks to [Go Sueyoshi](https://github.com/sue445)
|
154
|
+
|
155
|
+
* When using Net::HTTP, stubbed socket StubSocket#close and StubSocket#closed? behave more like the real sockets.
|
156
|
+
|
157
|
+
Thanks to [Ray Zane](https://github.com/rzane)
|
158
|
+
|
159
|
+
* Added `peeraddr`, `ssl_version` and `cipher` methods to stubbed sockets used by Net::HTTP.
|
160
|
+
|
161
|
+
Thanks to [Ray Zane](https://github.com/rzane)
|
162
|
+
|
163
|
+
* Added support for matching top-level array in JSON request body.
|
164
|
+
|
165
|
+
E.g.
|
166
|
+
|
167
|
+
````
|
168
|
+
stub_request(:post, 'www.example.com').with(body: [{a: 1}])
|
169
|
+
````
|
170
|
+
|
171
|
+
Thanks to [Cedric Sohrauer](https://github.com/cedrics)
|
172
|
+
|
173
|
+
# 3.16.2
|
174
|
+
|
175
|
+
* Minimum required Ruby version is 2.0.
|
176
|
+
|
177
|
+
# 3.16.0 (yanked)
|
178
|
+
|
179
|
+
* Fix leaky file descriptors and reuse socket for persistent connections.
|
180
|
+
|
181
|
+
Thanks to [Ray Zane](https://github.com/rzane)
|
182
|
+
|
183
|
+
* Allow specifying for what URIs or hosts, Net::HTTP should connect on start.
|
184
|
+
|
185
|
+
Thanks to [Ray Zane](https://github.com/rzane)
|
186
|
+
|
187
|
+
# 3.15.2
|
188
|
+
|
189
|
+
* Minimum required Ruby version is 2.0.
|
190
|
+
|
191
|
+
# 3.15.0 (yanked)
|
192
|
+
|
193
|
+
* fixed async-http adapter on Windows
|
194
|
+
|
195
|
+
Thanks to [Pavel Rosický](https://github.com/ahorek)
|
196
|
+
|
197
|
+
* Support for http.rb >= 5.0.2
|
198
|
+
|
199
|
+
Thanks to [ojab](https://github.com/ojab)
|
200
|
+
|
201
|
+
* Curb adapter supports headers with `:` character in the header value
|
202
|
+
|
203
|
+
Thanks to [Giorgio Gambino](https://github.com/mrbuzz)
|
204
|
+
|
205
|
+
* Support for matching body of JSON or application/x-www-form-urlencoded requests with content type header including charset.
|
206
|
+
|
207
|
+
Thanks to [Timmitry](https://github.com/Timmitry)
|
208
|
+
|
209
|
+
* Prevent double-wrapping http.rb features on non-stubbed requests
|
210
|
+
|
211
|
+
Thanks to [Michael Fairley](https://github.com/michaelfairley)
|
212
|
+
|
213
|
+
# 3.14.0
|
214
|
+
|
215
|
+
* Bump Addressable from 2.3.6 to 2.8.0
|
216
|
+
|
217
|
+
Thanks to [Eduardo Hernandez](https://github.com/EduardoGHdez)
|
218
|
+
|
219
|
+
# 3.13.0
|
220
|
+
|
221
|
+
* Support http.rb 5.x
|
222
|
+
|
223
|
+
Thanks to [Will Storey](https://github.com/horgh)
|
224
|
+
|
225
|
+
# 3.12.2
|
226
|
+
|
227
|
+
* Fixed em-http-request adapter to avoid calling middleware twice.
|
228
|
+
|
229
|
+
Thanks to [Alex Vondrak](https://github.com/ajvondrak)
|
230
|
+
|
231
|
+
# 3.12.1
|
232
|
+
|
233
|
+
* Fixed handling of URIs with IPv6 addresses with square brackets when in Net::HTTP adapter.
|
234
|
+
|
235
|
+
Thanks to [Johanna Hartmann](https://github.com/JohannaHartmann)
|
236
|
+
|
237
|
+
# 3.12.0
|
238
|
+
|
239
|
+
* Added support for handling custom JSON and XML content types e.g. 'application/vnd.api+json'
|
240
|
+
|
241
|
+
# 3.11.3
|
242
|
+
|
243
|
+
* Fixed async-http adapter to only considered requests as real if they are real.
|
244
|
+
|
245
|
+
Thanks to [Tony Schneider](https://github.com/tonywok) and [Samuel Williams](https://github.com/ioquatix)
|
246
|
+
|
247
|
+
# 3.11.2
|
248
|
+
|
249
|
+
* Fix for Manticore streaming mode
|
250
|
+
|
251
|
+
Thanks to [Oleksiy Kovyrin](https://github.com/kovyrin)
|
252
|
+
|
253
|
+
# 3.11.1
|
254
|
+
|
255
|
+
* Compatibility with async-http 0.54+
|
256
|
+
|
257
|
+
Thanks to [Jun Jiang](https://github.com/jasl)
|
258
|
+
|
259
|
+
# 3.11.0
|
260
|
+
|
261
|
+
* Added support for `features` in http.rb adapter.
|
262
|
+
|
263
|
+
Thanks to [Carl (ce07c3)](https://github.com/ce07c3)
|
264
|
+
|
265
|
+
# 3.10.0
|
266
|
+
|
267
|
+
* Added option to global stubs to have lower priority than local stubs.
|
268
|
+
|
269
|
+
WebMock.globally_stub_request(:after_local_stubs) do
|
270
|
+
{ body: "global stub body" }
|
271
|
+
end
|
272
|
+
|
273
|
+
stub_request(:get, "www.example.com").to_return(body: 'non-global stub body')
|
274
|
+
|
275
|
+
expect(http_request(:get, "http://www.example.com/").body).to eq("non-global stub body")
|
276
|
+
|
277
|
+
Thanks to [Marek Kasztelnik](https://github.com/mkasztelnik)
|
278
|
+
|
279
|
+
# 3.9.5
|
280
|
+
|
281
|
+
* Prevent overwriting `teardown` method in Test::Unit
|
282
|
+
|
283
|
+
Thanks to [Jesse Bowes](https://github.com/jessebs)
|
284
|
+
|
285
|
+
# 3.9.4
|
286
|
+
|
287
|
+
* More intuitive error message when stubbed response body was provided as Hash
|
288
|
+
|
289
|
+
Thanks to [Ben Koshy](https://github.com/BKSpurgeon)
|
290
|
+
|
291
|
+
# 3.9.3
|
292
|
+
|
293
|
+
* Make httpclient_adapter thread-safe
|
294
|
+
|
295
|
+
Thanks to [Adam Harwood](https://github.com/adam-harwood)
|
296
|
+
|
297
|
+
# 3.9.2
|
298
|
+
|
299
|
+
* Made global stubs thread-safe
|
300
|
+
|
301
|
+
Thanks to [Adam Harwood](https://github.com/adam-harwood)
|
302
|
+
|
303
|
+
# 3.9.1
|
304
|
+
|
305
|
+
* Fixed support for passing `URI` objects as second argument of `stub_request`
|
306
|
+
|
307
|
+
Thanks to [Ryan Kerr](https://github.com/leboshi)
|
308
|
+
|
309
|
+
## 3.9.0
|
310
|
+
|
311
|
+
* Allow using a "callable" (like a proc) as URI pattern
|
312
|
+
|
313
|
+
stub_request(:any, ->(uri) { true })
|
314
|
+
|
315
|
+
Thanks to [John Hawthorn](https://github.com/jhawthorn)
|
316
|
+
|
317
|
+
* Added stubbed IO on stubbed socket in Net::HTTP adapter.
|
318
|
+
|
319
|
+
Thanks to [Thilo Rusche](https://github.com/trusche)
|
320
|
+
|
321
|
+
* When 'webmock/rspec' is required, reset WebMock after all after(:each/example) hooks
|
322
|
+
|
323
|
+
Thanks to [Andrew Stuntz](https://github.com/drews256)
|
324
|
+
|
325
|
+
* Fixed `net_connect_allowed?` when invoked with no arguments, when there were any allowed URIs passed to `disable_net_connect?`.
|
326
|
+
|
327
|
+
Thanks to [Lucas Uyezu](https://github.com/lucasuyezu)
|
328
|
+
|
329
|
+
* Fixed async-http adapter which caused Async::HTTP::Client or Async::HTTP::Internet to hang and never return a response.
|
330
|
+
|
331
|
+
Thanks to [Bruno Sutic](https://github.com/bruno-) and [Samuel Williams](https://github.com/ioquatix)
|
332
|
+
|
333
|
+
* Fixed warning when using async-http adapter
|
334
|
+
|
335
|
+
Thanks to [Bruno Sutic](https://github.com/bruno-)
|
336
|
+
|
337
|
+
* Dropped support for Ruby 2.3 - EOL date: 2019-03-31
|
338
|
+
|
339
|
+
* Dropped support for Ruby 2.4 - EOL date: 2020-03-31
|
340
|
+
|
341
|
+
* 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.
|
342
|
+
|
343
|
+
Thanks to [Rafael França](https://github.com/rafaelfranca) and [guppy0356](https://github.com/guppy0356)
|
344
|
+
|
345
|
+
## 3.8.3
|
346
|
+
|
347
|
+
* Fixed problem introduced in version 3.4.2, which caused matching against Addressable::Template representing host part of the URI to raise an error.
|
348
|
+
|
349
|
+
Thanks to [Vesa Laakso](https://github.com/valscion)
|
350
|
+
|
351
|
+
## 3.8.2
|
352
|
+
|
353
|
+
* Support correct encoding parameter for HTTP.rb 2.x and earlier
|
354
|
+
|
355
|
+
Thanks to [Alex Coomans](https://github.com/drcapulet)
|
356
|
+
|
357
|
+
## 3.8.1
|
358
|
+
|
359
|
+
* Added support for mocking non-ASCII bodies when making requests with HTTP.rb
|
360
|
+
|
361
|
+
Thanks to [Patrik Ragnarsson](https://github.com/dentarg)
|
362
|
+
|
363
|
+
## 3.8.0
|
364
|
+
|
365
|
+
* Fixed options handling when initialising Async::HTTP::Client
|
366
|
+
|
367
|
+
Thanks to [Samuel Williams](https://github.com/ioquatix)
|
368
|
+
|
369
|
+
* Ruby 2.7 support.
|
370
|
+
|
371
|
+
Thanks to [Ryan Davis](https://github.com/zenspider) and [Brandur](https://github.com/brandur)
|
372
|
+
|
373
|
+
## 3.7.6
|
374
|
+
|
375
|
+
* Suppressed keyword argument warnings in Ruby 2.7 in async-http adapter.
|
376
|
+
|
377
|
+
Thanks to [Koichi ITO](https://github.com/koic)
|
378
|
+
|
379
|
+
## 3.7.5
|
380
|
+
|
381
|
+
* Suppress Excon warning generated by extra key
|
382
|
+
|
383
|
+
Thanks to [Marco Costa](https://github.com/marcotc)
|
384
|
+
|
385
|
+
## 3.7.4
|
386
|
+
|
387
|
+
* Resetting memoized response fields in Curb adapter.
|
388
|
+
|
389
|
+
Thanks to [Andrei Sidorov](https://github.com/heretge)
|
390
|
+
|
391
|
+
## 3.7.3
|
392
|
+
|
393
|
+
* Fix for http.rb. Allow passing an output buffer to HTTP::Response::Body#readpartial
|
394
|
+
|
395
|
+
Thanks to [George Claghorn](https://github.com/georgeclaghorn)
|
396
|
+
|
397
|
+
* Fixed Manticore adapter to invoke Manticore failure handler on stubbed timeout
|
398
|
+
|
399
|
+
Thanks to [Alex Junger](https://github.com/alexJunger)
|
400
|
+
|
401
|
+
* Added project metadata to the gemspec
|
402
|
+
|
403
|
+
Thanks to [Orien Madgwick](https://github.com/orien)
|
404
|
+
|
405
|
+
## 3.7.2
|
406
|
+
|
407
|
+
* Fixed handling of non UTF-8 encoded urls
|
408
|
+
|
409
|
+
Thanks to [Rafael França](https://github.com/rafaelfranca)
|
410
|
+
|
411
|
+
* Fixed "shadowing outer local variable" warning
|
412
|
+
|
413
|
+
Thanks to [y-yagi](https://github.com/y-yagi)
|
414
|
+
|
415
|
+
## 3.7.1
|
416
|
+
|
417
|
+
* Fixed Async::HTTP::Client adapter code to not cause Ruby warning
|
418
|
+
|
419
|
+
Thanks to [y-yagi](https://github.com/y-yagi)
|
420
|
+
|
421
|
+
## 3.7.0
|
422
|
+
|
423
|
+
* Support for Async::HTTP::Client
|
424
|
+
|
425
|
+
Thanks to [Andriy Yanko](https://github.com/ayanko)
|
426
|
+
|
427
|
+
## 3.6.2
|
428
|
+
|
429
|
+
* Fixed Patron adapter to handle HTTP/2 status line.
|
430
|
+
|
431
|
+
Thanks to [Fábio D. Batista](https://github.com/fabiob)
|
432
|
+
|
433
|
+
## 3.6.1
|
434
|
+
|
435
|
+
* Fixed issue with matching Addressable::Template without a period in the domain
|
436
|
+
|
437
|
+
Thanks to [Eike Send](https://github.com/eikes)
|
438
|
+
|
439
|
+
* Support for `write_timeout` in Net::HTTP
|
440
|
+
|
441
|
+
Thanks to [Claudio Poli](https://github.com/masterkain)
|
442
|
+
|
443
|
+
* Fixed issue with handling urls with ":80" or ":443" in the path.
|
444
|
+
|
445
|
+
Thanks to [Csaba Apagyi](https://github.com/thisismydesign) for reporting and to [Frederick Cheung](https://github.com/fcheung) for fixing the issue.
|
446
|
+
|
447
|
+
## 3.6.0
|
448
|
+
|
449
|
+
* Compatibility with the latest version of hashdiff gem, with constant changed from HashDiff to Hashdiff
|
450
|
+
|
451
|
+
Thanks to [Jeff Felchner](https://github.com/jfelchner)
|
452
|
+
|
453
|
+
* Added a hint to the error message raised when `with` method is called without args or a block.
|
454
|
+
|
455
|
+
Thanks to [Adam Sokolnicki](https://github.com/asok)
|
456
|
+
|
457
|
+
* Resetting configured HTTP method in Curb adapter after each request
|
458
|
+
|
459
|
+
Thanks to [tiendo1011](https://github.com/tiendo1011)
|
460
|
+
|
461
|
+
* Added `WebMock.enable_net_connect!` as an alias for `WebMock.allow_net_connect!`
|
462
|
+
and `WebMock.disallow_net_connect!` as an alias for `WebMock.disable_net_connect!`
|
463
|
+
|
464
|
+
Thanks to [SoonKhen OwYong](https://github.com/owyongsk)
|
465
|
+
|
466
|
+
* Fixed handling of empty arrays as query params when using Faraday
|
467
|
+
|
468
|
+
Thanks to [Ryan Moret](https://github.com/rcmoret)
|
469
|
+
|
470
|
+
## 3.5.1
|
471
|
+
|
472
|
+
* Disabling TracePoint defined in Net::BufferedIO in case of exception being raised.
|
473
|
+
|
474
|
+
Thanks to [Koichi Sasada](https://github.com/ko1)
|
475
|
+
|
476
|
+
|
3
477
|
## 3.5.0
|
4
478
|
|
5
479
|
* Ruby 2.6.0 support
|
@@ -341,9 +815,9 @@
|
|
341
815
|
* `WebMock.disable_net_connect` accepts `:allow` option with an object that responds to `#call`, receiving a `URI` object and returning a boolean:
|
342
816
|
|
343
817
|
|
344
|
-
|
818
|
+
denylist = ['google.com', 'facebook.com', 'apple.com']
|
345
819
|
allowed_sites = lambda{|uri|
|
346
|
-
|
820
|
+
denylist.none?{|site| uri.host.include?(site) }
|
347
821
|
}
|
348
822
|
WebMock.disable_net_connect!(:allow => allowed_sites)
|
349
823
|
|