Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 717 lines (403 sloc) 28.853 kB
9887d17 @jcf Prepare for 1.6.3 release
jcf authored
1 # Changelog
2
d083e68 @bblimke Bump to version 1.8.7
authored
3 ## 1.8.7
4
5 * Compatibility with RSpec >= 2.10
6
7 Thanks to [erwanlr](https://github.com/erwanlr) for reporting this issue.
8
9 * Add missing required rack environment variable SCRIPT_NAME
10
11 Thanks to [Eric Oestrich](https://github.com/oestrich)
12
13 * Fixed warnings due to @query_params not being initialized
14
15 Thanks to [Ben Bleything](https://github.com/bleything)
16
4711a0b @bblimke Bump version to 1.8.6
authored
17 ## 1.8.6
18
19 * Pass through SERVER_PORT when stubbing to rack
20
21 Thanks to [Eric Oestrich](https://github.com/oestrich)
22
23 * Fixed problem with missing parenthesis in `WebMock#net_connect_allowed?` conditions.
24
25 Thanks to [aindustries](https://github.com/aindustries)
26
576c596 @bblimke Bump to version 1.8.5
authored
27 ## 1.8.5
28
29 * WebMock::RackResponse supports basic auth
30
31 Thanks to [jugyo](https://github.com/jugyo)
32
4a0382d @bblimke Bump to version 1.8.4
authored
33 ## 1.8.4
34
35 * Warning message is printed when an unsupported version of a http library is loaded.
36
37 Thanks to [Alexander Staubo](https://github.com/alexstaubo) for reporting the problem and to [Myron Marston](https://github.com/myronmarston) for a help with solution.
38
3c9b625 @bblimke Bump version to 1.8.3
authored
39 ## 1.8.3
40
41 * Fixed compatibility with latest em-http-request
42
43 Thanks to [Paul Cortens](https://github.com/thoughtless)
44
3876948 @bblimke Update to version 1.8.2
authored
45 ## 1.8.2
46
47 * Prevent Webmock `hash_including` from overriding RSpec version 1 `hash_including` method.
48
49 Thanks to [Joe Karayusuf](https://github.com/karayusuf)
50
51 * Ensured WebMock handles RSpec 1 `hash_including` matcher for matching query params and body.
52
8825a2a @bblimke Update to version 1.8.1
authored
53 ## 1.8.1
54
55 * Ensured WebMock doesn't interfere with `em-synchrony`, when `em-synchrony/em-http` is not included.
56
57 Thanks to [Nick Recobra](https://github.com/oruen)
58
59 * Improved README
60
61 Thanks to [Jordan Elver](https://github.com/jordelver)
62
63
08783a7 @bblimke Update to version 1.8.0
authored
64 ## 1.8.0
68ba906 @bblimke Updated Changelog and Readme with the latest changes in master
authored
65
66 * Matching request body against partial hash.
67
68 stub_http_request(:post, "www.example.com").
69 with(:body => hash_including({:data => {:a => '1', :b => 'five'}}))
70
71 RestClient.post('www.example.com', "data[a]=1&data[b]=five&x=1",
72 :content_type => 'application/x-www-form-urlencoded') # ===> Success
73
74 request(:post, "www.example.com").
75 with(:body => hash_including({:data => {:a => '1', :b => 'five'}}),
76 :headers => 'Content-Type' => 'application/json').should have_been_made # ===> Success
77
78 Thanks to [Marnen Laibow-Koser](https://github.com/marnen) for help with this solution
79
80 * Matching request query params against partial hash.
81
82 stub_http_request(:get, "www.example.com").with(:query => hash_including({"a" => ["b", "c"]}))
83
84 RestClient.get("http://www.example.com/?a[]=b&a[]=c&x=1") # ===> Success
85
86 request(:get, "www.example.com").
87 with(:query => hash_including({"a" => ["b", "c"]})).should have_been_made # ===> Success
88
89 * Added support for Excon.
90
91 Thanks to [Dimitrij Denissenko](https://github.com/dim)
92
93 * Added support for setting expectations on the request stub with `assert_requested`
94
95 stub_get = stub_request(:get, "www.example.com")
96 stub_post = stub_request(:post, "www.example.com")
97
98 Net::HTTP.get('www.example.com', '/')
99
100 assert_requested(stub_get)
101 assert_not_requested(stub_post)
102
103 Thanks to [Nicolas Fouché](https://github.com/nfo)
104
105 * `WebMock.disable_net_connect!` accepts `RegExp` as `:allow` parameter
106
107 Thanks to [Frank Schumacher](https://github.com/thenoseman)
108
44de728 @bblimke Updated changelog with latest changes in master
authored
109 * Ensure multiple values for the same header can be recorded and played back
110
111 Thanks to [Myron Marston](https://github.com/myronmarston)
112
e56d313 @bblimke Updated dependency on Addressable to version >= 2.2.7 to handle neste…
authored
113 * Updated dependency on Addressable to version >= 2.2.7 to handle nested hash query values. I.e. `?one[two][three][]=four&one[two][three][]=five`
114
68ba906 @bblimke Updated Changelog and Readme with the latest changes in master
authored
115 * Fixed compatibility with Curb >= 0.7.16 This breaks compatibility with Curb < 0.7.16
116
117 * Fix #to_rack to handle non-array response bodies.
118
119 Thanks to [Tammer Saleh](https://github.com/tsaleh)
120
121 * Added `read_timeout` accessor to StubSocket which fixes compatibility with aws-sdk
122
123 Thanks to [Lin Jen-Shin](https://github.com/godfat)
124
125 * Fix warning "instance variable @query_params not initialized"
126
127 Thanks to [Joe Van Dyk](https://github.com/joevandyk)
128
129 * Using bytesize of message instead of its length for content-length header in em-http-request adapter.
130 This fixes a problem with messages getting truncated in Ruby >= 1.9
131
132 Thanks to [Mark Abramov](https://github.com/markiz)
133
5cd5aaf @bblimke Fixed problem with body params being matched even if params were diff…
authored
134 * Fixed problem with body params being matched even if params were different.
135
136 Thanks to [Evgeniy Dolzhenko](https://github.com/dolzenko) for reporting this issue.
137
a50c583 @bblimke Upgraded version to 1.7.10
authored
138 ## 1.7.10
139
140 * Yanked 1.7.9 and rebuilt gem on 1.8.7 to deal with syck/psych incompatibilties in gemspec.
141
4ff8cf1 @bblimke Version 1.7.9 changelog
authored
142 ## 1.7.9
143
144 * Fixed support for native Typhoeus timeouts.
145
146 Thanks to [Albert Llop](https://github.com/mrsimo)
147
148 * Fixed problem with WebMock and RSpec compatibility on TeamCity servers. See [this article](http://www.coding4streetcred.com/blog/post/Issue-RubyMine-31-Webmock-162-and-%E2%80%9CSpecconfigure%E2%80%9D-curse.aspx) for more details.
149
150 Thanks to [Christopher Pickslay](https://github.com/chrispix) from [Two Bit Labs](https://github.com/twobitlabs)
151
152
18b3e7f @myronmarston 1.7.8 release.
myronmarston authored
153 ## 1.7.8
154
155 * Fix each adapter so that it calls a `stub.with` block only once per
156 request. Previously, the block would be called two or three times per
157 request [Myron Marston](https://github.com/myronmarston).
158
4ff9f1a @bblimke Version 1.7.7 - RuPy 2011 Release
authored
159 ## 1.7.7 - RuPy 2011 release
160
161 * Passing response object to a block passed to `HTTPClient#do_get_block`. This fixes `HTTPClient.get_content` failures. [issue 130](https://github.com/bblimke/webmock/pull/130)
162
163 Thanks to [Chris McGrath](https://github.com/chrismcg)
164
165 * Cleaned up ruby warnings when running WebMock code with `-w`.
166
167 Thanks to [Stephen Celis](https://github.com/stephencelis)
168
169 * Curb adapter now correctly calls on_failure for 4xx response codes.
170
171 Thanks to [Eugene Pimenov](https://github.com/libc)
172
748ff35 @bblimke Version 1.7.6
authored
173 ## 1.7.6
174
175 * Support for the HTTPClient's request_filter feature
176
177 Thanks to [Roman Shterenzon](https://github.com/romanbsd)
178
4d848df @bblimke Version 1.7.5
authored
179 ## 1.7.5
180
181 * Added support for Patron 0.4.15. This change is not backward compatible so please upgrade Patron to version >= 0.4.15 if you want to use it with WebMock.
182
183 Thanks to [Andreas Garnæs](https://github.com/andreas)
184
b6ca337 @bblimke Version 1.7.4
authored
185 ## 1.7.4
186
187 * Added support for matching EM-HTTP-Request requests with body declared as a Hash
188
189 Thanks to [David Yeu](https://github.com/daveyeu)
190
6b422e4 @bblimke Version 1.7.3
authored
191 ## 1.7.3
192
193 * Added `Get`, `Post`, `Delete`, `Put`, `Head`, `Option` constants to replaced `Net::HTTP` to make it possible to marshal objects with these constants assigned to properties. This fixed problem with `tvdb_party` gem which serializes HTTParty responses.
194
195 Thanks to [Klaus Hartl](https://github.com/carhartl) for reporting this issue.
196
045f28a @bblimke Version 1.7.2
authored
197 ## 1.7.2
198
199 * Redefined `const_get` and `constants` methods on the replaced `Net::HTTP` to return same values as original `Net::HTTP`
200
81a3563 @bblimke Version 1.7.1
authored
201 ## 1.7.1
202
203 * Redefined `const_defined?` on the replaced `Net::HTTP` so that it returns true if constant is defined on the original `Net::HTTP`. This fixes problems with `"Net::HTTP::Get".constantize`.
204
205 Thanks to [Cássio Marques](https://github.com/cassiomarques) for reporting the issue and to [Myron Marston](https://github.com/myronmarston) for help with the solution.
206
8edff05 @bblimke Version 1.7.0
authored
207 ## 1.7.0
3cb39d7 @bblimke Version 1.7.0.pre Changelog
authored
208
607e1e8 @bblimke Added more examples to 1.7.0.pre Changelog
authored
209 * Fixed Net::HTTP adapter to not break normal Net::HTTP behaviour when network connections are allowed. This fixes **selenium-webdriver compatibility**!!!
3cb39d7 @bblimke Version 1.7.0.pre Changelog
authored
210
607e1e8 @bblimke Added more examples to 1.7.0.pre Changelog
authored
211 * Added support for EM-HTTP-Request 1.0.x and EM-Synchrony. Thanks to [Steve Hull](https://github.com/sdhull)
3cb39d7 @bblimke Version 1.7.0.pre Changelog
authored
212
213 * Added support for setting expectations to on a stub itself i.e.
214
215 stub = stub_request(:get, "www.example.com")
216 # ... make requests ...
217 stub.should have_been_requested
218
219 Thanks to [Aidan Feldman](https://github.com/afeld)
220
221 * Minitest support! Thanks to [Peter Higgins](https://github.com/phiggins)
222
21aba84 @bblimke Updated README and Changelog with inf about Typhoeus support
authored
223 * Added support for Typhoeus::Hydra
224
3cb39d7 @bblimke Version 1.7.0.pre Changelog
authored
225 * Added support for `Curb::Easy#http_post` and `Curb::Easy#http_post` with multiple arguments. Thanks to [Salvador Fuentes Jr](https://github.com/fuentesjr) and [Alex Rothenberg](https://github.com/alexrothenberg)
226
227 * Rack support. Requests can be stubbed to respond with a Rack app i.e.
228
229 class MyRackApp
230 def self.call(env)
231 [200, {}, ["Hello"]]
232 end
233 end
234
235 stub_request(:get, "www.example.com").to_rack(MyRackApp)
236
607e1e8 @bblimke Added more examples to 1.7.0.pre Changelog
authored
237 RestClient.get("www.example.com") # ===> "Hello"
238
239
fa61e9a @bblimke Fixed formatting in changelog
authored
240 Thanks to [Jay Adkisson](https://github.com/jayferd)
3cb39d7 @bblimke Version 1.7.0.pre Changelog
authored
241
607e1e8 @bblimke Added more examples to 1.7.0.pre Changelog
authored
242 * Added support for selective disabling and enabling of http lib adapters
17547a5 @bblimke Updated Changelog and README with info about enabling and disabling W…
authored
243
244 WebMock.disable! #disable WebMock (all adapters)
607e1e8 @bblimke Added more examples to 1.7.0.pre Changelog
authored
245 WebMock.disable!(:except => [:net_http]) #disable WebMock for all libs except Net::HTTP
17547a5 @bblimke Updated Changelog and README with info about enabling and disabling W…
authored
246 WebMock.enable! #enable WebMock (all adapters)
607e1e8 @bblimke Added more examples to 1.7.0.pre Changelog
authored
247 WebMock.enable!(:except => [:patron]) #enable WebMock for all libs except Patron
248
249 * The error message on an unstubbed request shows a code snippet with body as a hash when it was in url encoded form.
250
251 > RestClient.post('www.example.com', "data[a]=1&data[b]=2", :content_type => 'application/x-www-form-urlencoded')
252
253 WebMock::NetConnectNotAllowedError: Real HTTP connections are disabled....
254
255 You can stub this request with the following snippet:
256
257 stub_request(:post, "http://www.example.com/").
258 with(:body => {"data"=>{"a"=>"1", "b"=>"2"}},
259 :headers => { 'Content-Type'=>'application/x-www-form-urlencoded' }).
260 to_return(:status => 200, :body => "", :headers => {})
17547a5 @bblimke Updated Changelog and README with info about enabling and disabling W…
authored
261
607e1e8 @bblimke Added more examples to 1.7.0.pre Changelog
authored
262 Thanks to [Alex Rothenberg](https://github.com/alexrothenberg)
3cb39d7 @bblimke Version 1.7.0.pre Changelog
authored
263
fa61e9a @bblimke Fixed formatting in changelog
authored
264 * The error message on an unstubbed request shows currently registered request stubs.
607e1e8 @bblimke Added more examples to 1.7.0.pre Changelog
authored
265
266 > stub_request(:get, "www.example.net")
267 > stub_request(:get, "www.example.org")
268 > RestClient.get("www.example.com")
269 WebMock::NetConnectNotAllowedError: Real HTTP connections are disabled....
270
271 You can stub this request with the following snippet:
272
273 stub_request(:get, "http://www.example.com/").
274 to_return(:status => 200, :body => "", :headers => {})
275
276 registered request stubs:
277
278 stub_request(:get, "http://www.example.net/")
279 stub_request(:get, "http://www.example.org/")
280
281 Thanks to [Lin Jen-Shin](https://github.com/godfat) for suggesting this feature.
3cb39d7 @bblimke Version 1.7.0.pre Changelog
authored
282
283 * Fixed problem with matching requests with json body, when json strings have date format. Thanks to [Joakim Ekberg](https://github.com/kalasjocke) for reporting this issue.
284
607e1e8 @bblimke Added more examples to 1.7.0.pre Changelog
authored
285 * WebMock now attempts to require each http library before monkey patching it. This is to avoid problem when http library is required after WebMock is required. Thanks to [Myron Marston](https://github.com/myronmarston) for suggesting this change.
3cb39d7 @bblimke Version 1.7.0.pre Changelog
authored
286
287 * External requests can be disabled while allowing selected ports on selected hosts
288
289 WebMock.disable_net_connect!(:allow => "www.example.com:8080")
290 RestClient.get("www.example.com:80") # ===> Failure
291 RestClient.get("www.example.com:8080") # ===> Allowed.
292
fa61e9a @bblimke Fixed formatting in changelog
authored
293 Thanks to [Zach Dennis](https://github.com/zdennis)
3cb39d7 @bblimke Version 1.7.0.pre Changelog
authored
294
295 * Fixed syntax error in README examples, showing the ways of setting request expectations. Thanks to [Nikita Fedyashev](https://github.com/nfedyashev)
296
297
ae0286a @bblimke @jcf actually did a great job maintaining WebMock!
authored
298 **Many thanks to WebMock co-maintainer [James Conroy-Finn](https://github.com/jcf) who did a great job maintaining WebMock on his own for the last couple of months.**
3cb39d7 @bblimke Version 1.7.0.pre Changelog
authored
299
a62080b @jcf Update changelog and version number
jcf authored
300 ## 1.6.4
301
302 This is a quick slip release to regenerate the gemspec. Apparently
303 jeweler inserts dependencies twice if you use the `gemspec` method in
304 your Gemfile and declare gem dependencies in your gemspec.
305
306 https://github.com/technicalpickles/jeweler/issues/154
307
308 josevalim:
309
310 > This just bit me. I just released a gem with the wrong dependencies
311 > because I have updated jeweler. This should have been opt-in,
312 > otherwise a bunch of people using jeweler are going to release gems
313 > with the wrong dependencies because you are automatically importing
314 > from the Gemfile.
315
9887d17 @jcf Prepare for 1.6.3 release
jcf authored
316 ## 1.6.3
317
318 * Update the dependency on addressable to get around an issue in v2.2.5.
319 Thanks to [Peter Higgins](https://github.com/phiggins).
320
321 * Add support for matching parameter values using a regular expression
322 as well as a string. Thanks to [Oleg M Prozorov](https://github.com/oleg).
323
324 * Fix integration with httpclient as the internal API has changed.
325 Thanks to [Frank Prößdorf](https://github.com/endor).
326
327 * Ensure Curl::Easy#content_type is always set. Thanks to [Peter
328 Higgins](https://github.com/phiggins).
329
330 * Fix bug with em-http-request adapter stubbing responses that have a
331 chunked transfer encoding. Thanks to [Myron
332 Marston](https://github.com/myronmarston).
333
334 * Fix a load of spec failures with Patron, httpclient, and specs that
335 depended on the behaviour of example.com. Thanks to [Alex
336 Grigorovich](https://github.com/grig).
5313e02 Added version 0.9.0 features to CHANGELOG and README
Bartosz Blimke authored
337
e6af079 @bblimke Updated 1.6.2 changelog and credits
authored
338 ## 1.6.2
339
340 * Em-http-request adapter sets `last_effective_url` property. Thanks to [Sam Stokes](https://github.com/samstokes).
341
342 * Curb adapter supports `Curb::Easy#http_post` and `Curb::Easy#http_put` without arguments (by setting `post_body` or `put_data` beforehand). Thanks to [Eugene Bolshakov](https://github.com/eugenebolshakov)
343
f7b9c77 @bblimke Updated version 1.6.1 changelog
authored
344 ## 1.6.1
345
346 * Fixed issue with `webmock/rspec` which didn't load correctly if `rspec/core` was already required but `rspec/expectations` not.
347
7110c60 @bblimke Updated version 1.6.0 changelog
authored
348 ## 1.6.0
473b709 @bblimke Added WebMock.reset! method. WebMock.reset_webmock is now deprecated
authored
349
7110c60 @bblimke Updated version 1.6.0 changelog
authored
350 * Simplified integration with Test::Unit, RSpec and Cucumber. Now only a single file has to be required i.e.
acaab83 @bblimke Updated changelog with the latest changes in master.
authored
351
a251cb3 @jcf Indent files correctly and remove trailing whitespace
jcf authored
352 require 'webmock/test_unit'
353 require 'webmock/rspec'
354 require 'webmock/cucumber'
acaab83 @bblimke Updated changelog with the latest changes in master.
authored
355
65dd12b @bblimke Updated changelog with latest changes in master branch
authored
356 * The error message on unstubbed request now contains code snippet which can be used to stub this request. Thanks to Martyn Loughran for suggesting this feature.
357
e6925a2 @bblimke Updated changelog with the latest changes in master
authored
358 * The expectation failure message now contains a list of made requests. Thanks to Martyn Loughran for suggesting this feature.
359
86f36d2 @bblimke em-http-request adapter is activated by replacing EventMachine::HttpR…
authored
360 * Added `WebMock.print_executed_requests` method which can be useful to find out what requests were made until a given point.
361
7110c60 @bblimke Updated version 1.6.0 changelog
authored
362 * em-http-request adapter is now activated by replacing EventMachine::HttpRequest constant, instead of monkeypatching the original class.
86f36d2 @bblimke em-http-request adapter is activated by replacing EventMachine::HttpR…
authored
363
7110c60 @bblimke Updated version 1.6.0 changelog
authored
364 This technique is borrowed from em-http-request native mocking module. It allows switching WebMock adapter on an off, and using it interchangeably with em-http-request native mocking i.e:
86f36d2 @bblimke em-http-request adapter is activated by replacing EventMachine::HttpR…
authored
365
a251cb3 @jcf Indent files correctly and remove trailing whitespace
jcf authored
366 EventMachine::WebMockHttpRequest.activate!
367 EventMachine::WebMockHttpRequest.deactivate!
86f36d2 @bblimke em-http-request adapter is activated by replacing EventMachine::HttpR…
authored
368
a251cb3 @jcf Indent files correctly and remove trailing whitespace
jcf authored
369 Thanks to Martyn Loughran for suggesting this feature.
370
371 * `WebMock.reset_webmock` is deprecated in favour of new `WebMock.reset!`
7110c60 @bblimke Updated version 1.6.0 changelog
authored
372
373 * Fixed integration with Cucumber. Previously documented example didn't work with new versions of Cucumber.
72cd989 @bblimke Added WebMock.print_executed_requests method which can be useful to f…
authored
374
7110c60 @bblimke Updated version 1.6.0 changelog
authored
375 * Fixed stubbing requests with body declared as a hash. Thanks to Erik Michaels-Ober for reporting the issue.
a7cb4fa @bblimke Fixed issue with stubbing requests with request body declared as a ha…
authored
376
7110c60 @bblimke Updated version 1.6.0 changelog
authored
377 * Fixed issue with em-http-request adapter which didn't work when :query option value was passed as a string, not a hash. Thanks to Chee Yeo for reporting the issue.
178bfd1 @bblimke em-http-request adapter now works correctly when :query option value …
authored
378
7110c60 @bblimke Updated version 1.6.0 changelog
authored
379 * Fixed problem with assert_requested which didn't work if used outside rspec or test/unit
473b709 @bblimke Added WebMock.reset! method. WebMock.reset_webmock is now deprecated
authored
380
7bca10a @bblimke Don't use JSON to normalize hash body in request pattern. Removed dep…
authored
381 * Removed dependency on json gem
382
079a719 @bblimke Updated changelog with version 1.5.0 changes
authored
383 ## 1.5.0
f0408f8 @bblimke Added support for dynamically evaluated raw responses recorded with `…
authored
384
385 * Support for dynamically evaluated raw responses recorded with `curl -is` <br/>
386 i.e.
387
a251cb3 @jcf Indent files correctly and remove trailing whitespace
jcf authored
388 `curl -is www.example.com > /tmp/www.example.com.txt`
389 stub_request(:get, "www.example.com").to_return(lambda { |request| File.new("/tmp/#{request.uri.host.to_s}.txt" }))
f0408f8 @bblimke Added support for dynamically evaluated raw responses recorded with `…
authored
390
079a719 @bblimke Updated changelog with version 1.5.0 changes
authored
391 * `:net_http_connect_on_start` option can be passed to `WebMock.allow_net_connect!` and `WebMock.disable_net_connect!` methods, i.e.
ffbcdb3 @bblimke Updated changelog with the latest changes in master branch
authored
392
a251cb3 @jcf Indent files correctly and remove trailing whitespace
jcf authored
393 WebMock.allow_net_connect!(:net_http_connect_on_start => true)
ffbcdb3 @bblimke Updated changelog with the latest changes in master branch
authored
394
079a719 @bblimke Updated changelog with version 1.5.0 changes
authored
395 This forces WebMock Net::HTTP adapter to always connect on `Net::HTTP.start`. Check 'Connecting on Net::HTTP.start' in README for more information.
ffbcdb3 @bblimke Updated changelog with the latest changes in master branch
authored
396
079a719 @bblimke Updated changelog with version 1.5.0 changes
authored
397 Thanks to Alastair Brunton for reporting the issue and for fix suggestions.
4e313c2 @bblimke Updated CHANGELOG and README with information about net_http_connect_…
authored
398
079a719 @bblimke Updated changelog with version 1.5.0 changes
authored
399 * Fixed an issue where Patron spec tried to remove system temporary directory.
400 Thanks to Hans de Graaff
4e313c2 @bblimke Updated CHANGELOG and README with information about net_http_connect_…
authored
401
079a719 @bblimke Updated changelog with version 1.5.0 changes
authored
402 * WebMock specs now use RSpec 2
4e313c2 @bblimke Updated CHANGELOG and README with information about net_http_connect_…
authored
403
079a719 @bblimke Updated changelog with version 1.5.0 changes
authored
404 * `rake spec NO_CONNECTION=true` can now be used to only run WebMock specs which do not make real network connections
4e313c2 @bblimke Updated CHANGELOG and README with information about net_http_connect_…
authored
405
a53f1a0 @bblimke Updated CHANGELOG with version 1.4.0 changes
authored
406 ## 1.4.0
6eb8bb5 @bblimke WebMock tries to use already loaded version of RSpec (1.x or 2.x) (pr…
authored
407
aaf774b @bblimke Added info to changelog and readme about Curb support, implemented by…
authored
408 * Curb support!!! Thanks to the awesome work of Pete Higgins!
409
2328c00 @bblimke Updated Changelog with the latest changes in master
authored
410 * `include WebMock` is now deprecated to avoid method and constant name conflicts. Please `include WebMock::API` instead.
411
a251cb3 @jcf Indent files correctly and remove trailing whitespace
jcf authored
412 * `WebMock::API#request` is renamed to `WebMock::API#a_request` to prevent method name conflicts with i.e. Rails controller specs.
2328c00 @bblimke Updated Changelog with the latest changes in master
authored
413 WebMock.request is still available.
414
a53f1a0 @bblimke Updated CHANGELOG with version 1.4.0 changes
authored
415 * Deprecated `WebMock#request`, `WebMock#allow_net_connect!`, `WebMock#net_connect_allowed?`, `WebMock#registered_request?`, `WebMock#reset_callbacks`, `WebMock#after_request` instance methods. These methods are still available, but only as WebMock class methods.
9fded75 @bblimke Updated CHANGELOG with more detailed information on changes in master
authored
416
a53f1a0 @bblimke Updated CHANGELOG with version 1.4.0 changes
authored
417 * Removed `WebMock.response_for_request` and `WebMock.assertion_failure` which were only used internally and were not documented.
9fded75 @bblimke Updated CHANGELOG with more detailed information on changes in master
authored
418
c646491 @bblimke :allow_localhost => true' now permits 0.0.0.0 in addition to 127.0.0.…
authored
419 * :allow_localhost => true' now permits 0.0.0.0 in addition to 127.0.0.1 and 'localhost'. Thanks to Myron Marston and Mike Gehard for suggesting this.
420
a53f1a0 @bblimke Updated CHANGELOG with version 1.4.0 changes
authored
421 * Fixed issue with both RSpec 1.x and 2.x being available.
6eb8bb5 @bblimke WebMock tries to use already loaded version of RSpec (1.x or 2.x) (pr…
authored
422
a53f1a0 @bblimke Updated CHANGELOG with version 1.4.0 changes
authored
423 WebMock now tries to use already loaded version of RSpec (1.x or 2.x). Previously it was loading RSpec 2.0 if available, even if RSpec 1.3 was already loaded.
6eb8bb5 @bblimke WebMock tries to use already loaded version of RSpec (1.x or 2.x) (pr…
authored
424
425 Thanks to Hans de Graaff for reporting this.
426
9acf181 @bblimke Updated changelog for version 1.4.0
authored
427 * Changed runtime dependency on Addressable version 2.2.2 which fixes handling of percent-escaped '+'
428
67a0819 @bblimke Version 1.3.5 changelog + updated docs
authored
429 ## 1.3.5
430
431 * External requests can be disabled while allowing selected hosts. Thanks to Charles Li and Ryan Bigg
432
433 This feature was available before only for localhost with `:allow_localhost => true`
434
8118632 @bblimke Fixed indentation in changelog
authored
435 WebMock.disable_net_connect!(:allow => "www.example.org")
67a0819 @bblimke Version 1.3.5 changelog + updated docs
authored
436
8118632 @bblimke Fixed indentation in changelog
authored
437 Net::HTTP.get('www.something.com', '/') # ===> Failure
67a0819 @bblimke Version 1.3.5 changelog + updated docs
authored
438
8118632 @bblimke Fixed indentation in changelog
authored
439 Net::HTTP.get('www.example.org', '/') # ===> Allowed.
67a0819 @bblimke Version 1.3.5 changelog + updated docs
authored
440
441 * Fixed Net::HTTP adapter so that it preserves the original behavior of Net::HTTP.
442
443 When making a request with a block that calls #read_body on the request,
444 Net::HTTP causes the body to be set to a Net::ReadAdapter, but WebMock was causing the body to be set to a string.
445
688e687 Version 1.3.4 changelog
Bartosz Blimke and Oliver Nightingale authored
446 ## 1.3.4
447
448 * Fixed Net::HTTP adapter to handle cases where a block with `read_body` call is passed to `request`.
449 This fixes compatibility with `open-uri`. Thanks to Mark Evans for reporting the issue.
450
db5fcf4 Version 1.3.3 changelog.
Bartosz Blimke and Ben Pickles authored
451 ## 1.3.3
452
453 * Fixed handling of multiple values for the same response header for Net::HTTP. Thanks to Myron Marston for reporting the issue.
454
27c0f65 Version 1.3.2 changelog
Bartosz Blimke and Ben Pickles authored
455 ## 1.3.2
456
457 * Fixed compatibility with EM-HTTP-Request >= 0.2.9. Thanks to Myron Marston for reporting the issue.
458
15f888e @bblimke The less hacky way to get the stream behaviour working for em-http-re…
authored
459 ## 1.3.1
460
60fa244 @bblimke Updated changelog
authored
461 * The less hacky way to get the stream behaviour working for em-http-request. Thanks to Martyn Loughran
462
463 * Fixed issues where Net::HTTP was not accepting valid nil response body. Thanks to Muness Alrubaie
15f888e @bblimke The less hacky way to get the stream behaviour working for em-http-re…
authored
464
354af66 Updated CHANGELOG width version 1.3.0 changes
Bartosz Blimke authored
465 ## 1.3.0
466
467 * Added support for [em-http-request](http://github.com/igrigorik/em-http-request)
468
a251cb3 @jcf Indent files correctly and remove trailing whitespace
jcf authored
469 * Matching query params using a hash
470
8118632 @bblimke Fixed indentation in changelog
authored
471 stub_http_request(:get, "www.example.com").with(:query => {"a" => ["b", "c"]})
a251cb3 @jcf Indent files correctly and remove trailing whitespace
jcf authored
472
8118632 @bblimke Fixed indentation in changelog
authored
473 RestClient.get("http://www.example.com/?a[]=b&a[]=c") # ===> Success
354af66 Updated CHANGELOG width version 1.3.0 changes
Bartosz Blimke authored
474
8118632 @bblimke Fixed indentation in changelog
authored
475 request(:get, "www.example.com").with(:query => {"a" => ["b", "c"]}).should have_been_made # ===> Success
354af66 Updated CHANGELOG width version 1.3.0 changes
Bartosz Blimke authored
476
477 * Matching request body against a hash. Body can be URL-Encoded, JSON or XML.
26cb92f Small improvements to CHANGELOG for version 1.3.0
Bartosz Blimke authored
478
354af66 Updated CHANGELOG width version 1.3.0 changes
Bartosz Blimke authored
479 (Thanks to Steve Tooke for the idea and a solution for url-encoded bodies)
480
8118632 @bblimke Fixed indentation in changelog
authored
481 stub_http_request(:post, "www.example.com").
482 with(:body => {:data => {:a => '1', :b => 'five'}})
a251cb3 @jcf Indent files correctly and remove trailing whitespace
jcf authored
483
8118632 @bblimke Fixed indentation in changelog
authored
484 RestClient.post('www.example.com', "data[a]=1&data[b]=five",
485 :content_type => 'application/x-www-form-urlencoded') # ===> Success
a251cb3 @jcf Indent files correctly and remove trailing whitespace
jcf authored
486
8118632 @bblimke Fixed indentation in changelog
authored
487 RestClient.post('www.example.com', '{"data":{"a":"1","b":"five"}}',
488 :content_type => 'application/json') # ===> Success
a251cb3 @jcf Indent files correctly and remove trailing whitespace
jcf authored
489
8118632 @bblimke Fixed indentation in changelog
authored
490 RestClient.post('www.example.com', '<data a="1" b="five" />',
491 :content_type => 'application/xml' ) # ===> Success
a251cb3 @jcf Indent files correctly and remove trailing whitespace
jcf authored
492
8118632 @bblimke Fixed indentation in changelog
authored
493 request(:post, "www.example.com").
b2f1a0c @bblimke Added part of code in changelog, which was removed by mistake
authored
494 with(:body => {:data => {:a => '1', :b => 'five'}},
495 :headers => 'Content-Type' => 'application/json').should have_been_made # ===> Success
354af66 Updated CHANGELOG width version 1.3.0 changes
Bartosz Blimke authored
496
497 * Request callbacks (Thanks to Myron Marston for all suggestions)
498
499 WebMock can now invoke callbacks for stubbed or real requests:
500
8118632 @bblimke Fixed indentation in changelog
authored
501 WebMock.after_request do |request_signature, response|
502 puts "Request #{request_signature} was made and #{response} was returned"
503 end
a251cb3 @jcf Indent files correctly and remove trailing whitespace
jcf authored
504
354af66 Updated CHANGELOG width version 1.3.0 changes
Bartosz Blimke authored
505 invoke callbacks for real requests only and except requests made with Patron client
506
8118632 @bblimke Fixed indentation in changelog
authored
507 WebMock.after_request(:except => [:patron], :real_requests_only => true) do |request_signature, response|
508 puts "Request #{request_signature} was made and #{response} was returned"
509 end
354af66 Updated CHANGELOG width version 1.3.0 changes
Bartosz Blimke authored
510
511 * `to_raise()` now accepts an exception instance or a string as argument in addition to an exception class
512
8118632 @bblimke Fixed indentation in changelog
authored
513 stub_request(:any, 'www.example.net').to_raise(StandardError.new("some error"))
a251cb3 @jcf Indent files correctly and remove trailing whitespace
jcf authored
514
8118632 @bblimke Fixed indentation in changelog
authored
515 stub_request(:any, 'www.example.net').to_raise("some error")
354af66 Updated CHANGELOG width version 1.3.0 changes
Bartosz Blimke authored
516
26cb92f Small improvements to CHANGELOG for version 1.3.0
Bartosz Blimke authored
517 * Matching requests based on a URI is 30% faster
354af66 Updated CHANGELOG width version 1.3.0 changes
Bartosz Blimke authored
518
519 * Fixed constant namespace issues in HTTPClient adapter. Thanks to Nathaniel Bibler for submitting a patch.
520
fd2472a Version 1.2.2 changelog
Bartosz Blimke authored
521 ## 1.2.2
522
523 * Fixed problem where ArgumentError was raised if query params were made up of an array e.g. data[]=a&data[]=b. Thanks to Steve Tooke
524
5803f31 Version bump to 1.2.1
Bartosz Blimke authored
525 ## 1.2.1
526
527 * Changed license from GPL to MIT
528
529 * Fixed gemspec file. Thanks to Razic
530
a251cb3 @jcf Indent files correctly and remove trailing whitespace
jcf authored
531 ## 1.2.0
31b3ffb Added version 1.2.0 changelog
Bartosz Blimke authored
532
533 * RSpec 2 compatibility. Thanks to Sam Phillips!
534
535 * :allow_localhost => true' now permits 127.0.0.1 as well as 'localhost'. Thanks to Mack Earnhardt
536
537 * Request URI matching in now 2x faster!
538
539
4a04017 Added 1.1.0 changelog
Bartosz Blimke authored
540 ## 1.1.0
541
ee7b3b4 Fixed spelling
Bartosz Blimke authored
542 * [VCR](http://github.com/myronmarston/vcr/) compatibility. Many thanks to Myron Marston for all suggestions.
4a04017 Added 1.1.0 changelog
Bartosz Blimke authored
543
a251cb3 @jcf Indent files correctly and remove trailing whitespace
jcf authored
544 * Support for stubbing requests and returning responses with multiple headers with the same name. i.e multiple Accept headers.
545
546 stub_http_request(:get, 'www.example.com').
547 with(:headers => {'Accept' => ['image/png', 'image/jpeg']}).
548 to_return(:body => 'abc')
549 RestClient.get('www.example.com',
550 {"Accept" => ['image/png', 'image/jpeg']}) # ===> "abc\n"
4a04017 Added 1.1.0 changelog
Bartosz Blimke authored
551
552 * When real net connections are disabled and unstubbed request is made, WebMock throws WebMock::NetConnectNotAllowedError instead of assertion error or StandardError.
553
554 * Added WebMock.version()
555
556
66519c1 Updated changelog with 1.0.0 changes
Bartosz Blimke authored
557 ## 1.0.0
558
559 * Added support for [Patron](http://toland.github.com/patron/)
560
561 * Responses dynamically evaluated from block (idea and implementation by Tom Ward)
562
a251cb3 @jcf Indent files correctly and remove trailing whitespace
jcf authored
563 stub_request(:any, 'www.example.net').
564 to_return { |request| {:body => request.body} }
66519c1 Updated changelog with 1.0.0 changes
Bartosz Blimke authored
565
a251cb3 @jcf Indent files correctly and remove trailing whitespace
jcf authored
566 RestClient.post('www.example.net', 'abc') # ===> "abc\n"
66519c1 Updated changelog with 1.0.0 changes
Bartosz Blimke authored
567
568 * Responses dynamically evaluated from lambda (idea and implementation by Tom Ward)
569
a251cb3 @jcf Indent files correctly and remove trailing whitespace
jcf authored
570 stub_request(:any, 'www.example.net').
571 to_return(lambda { |request| {:body => request.body} })
66519c1 Updated changelog with 1.0.0 changes
Bartosz Blimke authored
572
a251cb3 @jcf Indent files correctly and remove trailing whitespace
jcf authored
573 RestClient.post('www.example.net', 'abc') # ===> "abc\n"
66519c1 Updated changelog with 1.0.0 changes
Bartosz Blimke authored
574
a251cb3 @jcf Indent files correctly and remove trailing whitespace
jcf authored
575 * Response with custom status message
66519c1 Updated changelog with 1.0.0 changes
Bartosz Blimke authored
576
a251cb3 @jcf Indent files correctly and remove trailing whitespace
jcf authored
577 stub_request(:any, "www.example.com").to_return(:status => [500, "Internal Server Error"])
66519c1 Updated changelog with 1.0.0 changes
Bartosz Blimke authored
578
a251cb3 @jcf Indent files correctly and remove trailing whitespace
jcf authored
579 req = Net::HTTP::Get.new("/")
580 Net::HTTP.start("www.example.com") { |http| http.request(req) }.message # ===> "Internal Server Error"
66519c1 Updated changelog with 1.0.0 changes
Bartosz Blimke authored
581
c3c92ba Added information about allowing localhost to version 1.0.0 changelog
Bartosz Blimke authored
582 * Raising timeout errors (suggested by Jeffrey Jones) (compatibility with Ruby 1.8.6 by Mack Earnhardt)
66519c1 Updated changelog with 1.0.0 changes
Bartosz Blimke authored
583
a251cb3 @jcf Indent files correctly and remove trailing whitespace
jcf authored
584 stub_request(:any, 'www.example.net').to_timeout
66519c1 Updated changelog with 1.0.0 changes
Bartosz Blimke authored
585
a251cb3 @jcf Indent files correctly and remove trailing whitespace
jcf authored
586 RestClient.post('www.example.net', 'abc') # ===> RestClient::RequestTimeout
66519c1 Updated changelog with 1.0.0 changes
Bartosz Blimke authored
587
c3c92ba Added information about allowing localhost to version 1.0.0 changelog
Bartosz Blimke authored
588 * External requests can be disabled while allowing localhost (idea and implementation by Mack Earnhardt)
589
a251cb3 @jcf Indent files correctly and remove trailing whitespace
jcf authored
590 WebMock.disable_net_connect!(:allow_localhost => true)
c3c92ba Added information about allowing localhost to version 1.0.0 changelog
Bartosz Blimke authored
591
a251cb3 @jcf Indent files correctly and remove trailing whitespace
jcf authored
592 Net::HTTP.get('www.something.com', '/') # ===> Failure
c3c92ba Added information about allowing localhost to version 1.0.0 changelog
Bartosz Blimke authored
593
a251cb3 @jcf Indent files correctly and remove trailing whitespace
jcf authored
594 Net::HTTP.get('localhost:9887', '/') # ===> Allowed. Perhaps to Selenium?
c3c92ba Added information about allowing localhost to version 1.0.0 changelog
Bartosz Blimke authored
595
596
66519c1 Updated changelog with 1.0.0 changes
Bartosz Blimke authored
597 ### Bug fixes
598
599 * Fixed issue where Net::HTTP adapter didn't work for requests with body responding to read (reported by Tekin Suleyman)
c3c92ba Added information about allowing localhost to version 1.0.0 changelog
Bartosz Blimke authored
600 * Fixed issue where request stub with headers declared as nil was matching requests with non empty headers
66519c1 Updated changelog with 1.0.0 changes
Bartosz Blimke authored
601
b6c3b3b Version bump to 0.9.1
Bartosz Blimke authored
602 ## 0.9.1
603
604 * Fixed issue where response status code was not read from raw (curl -is) responses
605
5313e02 Added version 0.9.0 features to CHANGELOG and README
Bartosz Blimke authored
606 ## 0.9.0
a251cb3 @jcf Indent files correctly and remove trailing whitespace
jcf authored
607
5313e02 Added version 0.9.0 features to CHANGELOG and README
Bartosz Blimke authored
608 * Matching requests against provided block (by Sergio Gil)
609
a251cb3 @jcf Indent files correctly and remove trailing whitespace
jcf authored
610 stub_request(:post, "www.example.com").with { |request| request.body == "abc" }.to_return(:body => "def")
611 RestClient.post('www.example.com', 'abc') # ===> "def\n"
612 request(:post, "www.example.com").with { |req| req.body == "abc" }.should have_been_made
613 #or
614 assert_requested(:post, "www.example.com") { |req| req.body == "abc" }
5313e02 Added version 0.9.0 features to CHANGELOG and README
Bartosz Blimke authored
615
66519c1 Updated changelog with 1.0.0 changes
Bartosz Blimke authored
616 * Matching request body against regular expressions (suggested by Ben Pickles)
5313e02 Added version 0.9.0 features to CHANGELOG and README
Bartosz Blimke authored
617
a251cb3 @jcf Indent files correctly and remove trailing whitespace
jcf authored
618 stub_request(:post, "www.example.com").with(:body => /^.*world$/).to_return(:body => "abc")
619 RestClient.post('www.example.com', 'hello world') # ===> "abc\n"
620
66519c1 Updated changelog with 1.0.0 changes
Bartosz Blimke authored
621 * Matching request headers against regular expressions (suggested by Ben Pickles)
5313e02 Added version 0.9.0 features to CHANGELOG and README
Bartosz Blimke authored
622
a251cb3 @jcf Indent files correctly and remove trailing whitespace
jcf authored
623 stub_request(:post, "www.example.com").with(:headers => {"Content-Type" => /image\/.+/}).to_return(:body => "abc")
624 RestClient.post('www.example.com', '', {'Content-Type' => 'image/png'}) # ===> "abc\n"
5313e02 Added version 0.9.0 features to CHANGELOG and README
Bartosz Blimke authored
625
626 * Replaying raw responses recorded with `curl -is`
627
a251cb3 @jcf Indent files correctly and remove trailing whitespace
jcf authored
628 `curl -is www.example.com > /tmp/example_curl_-is_output.txt`
629 raw_response_file = File.new("/tmp/example_curl_-is_output.txt")
5313e02 Added version 0.9.0 features to CHANGELOG and README
Bartosz Blimke authored
630
a251cb3 @jcf Indent files correctly and remove trailing whitespace
jcf authored
631 from file
632
633 stub_request(:get, "www.example.com").to_return(raw_response_file)
634
635 or string
636
637 stub_request(:get, "www.example.com").to_return(raw_response_file.read)
5313e02 Added version 0.9.0 features to CHANGELOG and README
Bartosz Blimke authored
638
639 * Multiple responses for repeated requests
640
a251cb3 @jcf Indent files correctly and remove trailing whitespace
jcf authored
641 stub_request(:get, "www.example.com").to_return({:body => "abc"}, {:body => "def"})
642 Net::HTTP.get('www.example.com', '/') # ===> "abc\n"
643 Net::HTTP.get('www.example.com', '/') # ===> "def\n"
5313e02 Added version 0.9.0 features to CHANGELOG and README
Bartosz Blimke authored
644
645 * Multiple responses using chained `to_return()` or `to_raise()` declarations
646
a251cb3 @jcf Indent files correctly and remove trailing whitespace
jcf authored
647 stub_request(:get, "www.example.com").
648 to_return({:body => "abc"}).then. #then() just is a syntactic sugar
649 to_return({:body => "def"}).then.
650 to_raise(MyException)
651 Net::HTTP.get('www.example.com', '/') # ===> "abc\n"
652 Net::HTTP.get('www.example.com', '/') # ===> "def\n"
653 Net::HTTP.get('www.example.com', '/') # ===> MyException raised
654
5313e02 Added version 0.9.0 features to CHANGELOG and README
Bartosz Blimke authored
655 * Specifying number of times given response should be returned
656
a251cb3 @jcf Indent files correctly and remove trailing whitespace
jcf authored
657 stub_request(:get, "www.example.com").
658 to_return({:body => "abc"}).times(2).then.
659 to_return({:body => "def"})
660
661 Net::HTTP.get('www.example.com', '/') # ===> "abc\n"
662 Net::HTTP.get('www.example.com', '/') # ===> "abc\n"
663 Net::HTTP.get('www.example.com', '/') # ===> "def\n"
664
5313e02 Added version 0.9.0 features to CHANGELOG and README
Bartosz Blimke authored
665 * Added support for `Net::HTTP::Post#body_stream`
666
a251cb3 @jcf Indent files correctly and remove trailing whitespace
jcf authored
667 This fixes compatibility with new versions of RestClient
668
5313e02 Added version 0.9.0 features to CHANGELOG and README
Bartosz Blimke authored
669 * WebMock doesn't suppress default request headers added by http clients anymore.
670
a251cb3 @jcf Indent files correctly and remove trailing whitespace
jcf authored
671 i.e. Net::HTTP adds `'Accept'=>'*/*'` to all requests by default
672
673
674
5313e02 Added version 0.9.0 features to CHANGELOG and README
Bartosz Blimke authored
675 ## 0.8.2
a251cb3 @jcf Indent files correctly and remove trailing whitespace
jcf authored
676
5313e02 Added version 0.9.0 features to CHANGELOG and README
Bartosz Blimke authored
677 * Fixed issue where WebMock was not closing IO object passed as response body after reading it.
678 * Ruby 1.9.2 compat: Use `File#expand_path` for require path because "." is not be included in LOAD_PATH since Ruby 1.9.2
679
680
681 ## 0.8.1
a251cb3 @jcf Indent files correctly and remove trailing whitespace
jcf authored
682
5313e02 Added version 0.9.0 features to CHANGELOG and README
Bartosz Blimke authored
683 * Fixed HTTPClient adapter compatibility with Ruby 1.8.6 (reported by Piotr Usewicz)
684 * Net:HTTP adapter now handles request body assigned as Net::HTTP::Post#body attribute (fixed by Mack Earnhardt)
685 * Fixed issue where requests were not matching stubs with Accept header set.(reported by Piotr Usewicz)
686 * Fixed compatibility with Ruby 1.9.1, 1.9.2 and JRuby 1.3.1 (reported by Diego E. “Flameeyes” Pettenò)
687 * Fixed issue with response body declared as IO object and multiple requests (reported by Niels Meersschaert)
688 * Fixed "undefined method `assertion_failure'" error (reported by Nick Plante)
689
690
691 ## 0.8.0
692
693 * Support for HTTPClient (sync and async requests)
a251cb3 @jcf Indent files correctly and remove trailing whitespace
jcf authored
694 * Support for dynamic responses. Response body and headers can be now declared as lambda.
695 (Thanks to Ivan Vega ( @ivanyv ) for suggesting this feature)
5313e02 Added version 0.9.0 features to CHANGELOG and README
Bartosz Blimke authored
696 * Support for stubbing and expecting requests with empty body
697 * Executing non-stubbed request leads to failed expectation instead of error
698
699
700 ### Bug fixes
701
702 * Basic authentication now works correctly
703 * Fixed problem where WebMock didn't call a block with the response when block was provided
704 * Fixed problem where uris with single slash were not matching uris without path provided
705
706
707 ## 0.7.3
708
709 * Clarified documentation
710 * Fixed some issues with loading of Webmock classes
711 * Test::Unit and RSpec adapters have to be required separately
712
713
714 ## 0.7.2
715
716 * Added support for matching escaped and non escaped URLs
Something went wrong with that request. Please try again.