Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 578 lines (330 sloc) 24.477 kb
9887d17 @jcf Prepare for 1.6.3 release
jcf authored
1 # Changelog
2
4ff8cf1 @bblimke Version 1.7.9 changelog
authored
3 ## 1.7.9
4
5 * Fixed support for native Typhoeus timeouts.
6
7 Thanks to [Albert Llop](https://github.com/mrsimo)
8
9 * 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.
10
11 Thanks to [Christopher Pickslay](https://github.com/chrispix) from [Two Bit Labs](https://github.com/twobitlabs)
12
13
18b3e7f @myronmarston 1.7.8 release.
myronmarston authored
14 ## 1.7.8
15
16 * Fix each adapter so that it calls a `stub.with` block only once per
17 request. Previously, the block would be called two or three times per
18 request [Myron Marston](https://github.com/myronmarston).
19
4ff9f1a @bblimke Version 1.7.7 - RuPy 2011 Release
authored
20 ## 1.7.7 - RuPy 2011 release
21
22 * 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)
23
24 Thanks to [Chris McGrath](https://github.com/chrismcg)
25
26 * Cleaned up ruby warnings when running WebMock code with `-w`.
27
28 Thanks to [Stephen Celis](https://github.com/stephencelis)
29
30 * Curb adapter now correctly calls on_failure for 4xx response codes.
31
32 Thanks to [Eugene Pimenov](https://github.com/libc)
33
748ff35 @bblimke Version 1.7.6
authored
34 ## 1.7.6
35
36 * Support for the HTTPClient's request_filter feature
37
38 Thanks to [Roman Shterenzon](https://github.com/romanbsd)
39
4d848df @bblimke Version 1.7.5
authored
40 ## 1.7.5
41
42 * 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.
43
44 Thanks to [Andreas Garnæs](https://github.com/andreas)
45
b6ca337 @bblimke Version 1.7.4
authored
46 ## 1.7.4
47
48 * Added support for matching EM-HTTP-Request requests with body declared as a Hash
49
50 Thanks to [David Yeu](https://github.com/daveyeu)
51
6b422e4 @bblimke Version 1.7.3
authored
52 ## 1.7.3
53
54 * 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.
55
56 Thanks to [Klaus Hartl](https://github.com/carhartl) for reporting this issue.
57
045f28a @bblimke Version 1.7.2
authored
58 ## 1.7.2
59
60 * Redefined `const_get` and `constants` methods on the replaced `Net::HTTP` to return same values as original `Net::HTTP`
61
81a3563 @bblimke Version 1.7.1
authored
62 ## 1.7.1
63
64 * 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`.
65
66 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.
67
8edff05 @bblimke Version 1.7.0
authored
68 ## 1.7.0
3cb39d7 @bblimke Version 1.7.0.pre Changelog
authored
69
607e1e8 @bblimke Added more examples to 1.7.0.pre Changelog
authored
70 * 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
71
607e1e8 @bblimke Added more examples to 1.7.0.pre Changelog
authored
72 * 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
73
74 * Added support for setting expectations to on a stub itself i.e.
75
76 stub = stub_request(:get, "www.example.com")
77 # ... make requests ...
78 stub.should have_been_requested
79
80 Thanks to [Aidan Feldman](https://github.com/afeld)
81
82 * Minitest support! Thanks to [Peter Higgins](https://github.com/phiggins)
83
21aba84 @bblimke Updated README and Changelog with inf about Typhoeus support
authored
84 * Added support for Typhoeus::Hydra
85
3cb39d7 @bblimke Version 1.7.0.pre Changelog
authored
86 * 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)
87
88 * Rack support. Requests can be stubbed to respond with a Rack app i.e.
89
90 class MyRackApp
91 def self.call(env)
92 [200, {}, ["Hello"]]
93 end
94 end
95
96 stub_request(:get, "www.example.com").to_rack(MyRackApp)
97
607e1e8 @bblimke Added more examples to 1.7.0.pre Changelog
authored
98 RestClient.get("www.example.com") # ===> "Hello"
99
100
fa61e9a @bblimke Fixed formatting in changelog
authored
101 Thanks to [Jay Adkisson](https://github.com/jayferd)
3cb39d7 @bblimke Version 1.7.0.pre Changelog
authored
102
607e1e8 @bblimke Added more examples to 1.7.0.pre Changelog
authored
103 * 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
104
105 WebMock.disable! #disable WebMock (all adapters)
607e1e8 @bblimke Added more examples to 1.7.0.pre Changelog
authored
106 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
107 WebMock.enable! #enable WebMock (all adapters)
607e1e8 @bblimke Added more examples to 1.7.0.pre Changelog
authored
108 WebMock.enable!(:except => [:patron]) #enable WebMock for all libs except Patron
109
110 * The error message on an unstubbed request shows a code snippet with body as a hash when it was in url encoded form.
111
112 > RestClient.post('www.example.com', "data[a]=1&data[b]=2", :content_type => 'application/x-www-form-urlencoded')
113
114 WebMock::NetConnectNotAllowedError: Real HTTP connections are disabled....
115
116 You can stub this request with the following snippet:
117
118 stub_request(:post, "http://www.example.com/").
119 with(:body => {"data"=>{"a"=>"1", "b"=>"2"}},
120 :headers => { 'Content-Type'=>'application/x-www-form-urlencoded' }).
121 to_return(:status => 200, :body => "", :headers => {})
17547a5 @bblimke Updated Changelog and README with info about enabling and disabling W…
authored
122
607e1e8 @bblimke Added more examples to 1.7.0.pre Changelog
authored
123 Thanks to [Alex Rothenberg](https://github.com/alexrothenberg)
3cb39d7 @bblimke Version 1.7.0.pre Changelog
authored
124
fa61e9a @bblimke Fixed formatting in changelog
authored
125 * The error message on an unstubbed request shows currently registered request stubs.
607e1e8 @bblimke Added more examples to 1.7.0.pre Changelog
authored
126
127 > stub_request(:get, "www.example.net")
128 > stub_request(:get, "www.example.org")
129 > RestClient.get("www.example.com")
130 WebMock::NetConnectNotAllowedError: Real HTTP connections are disabled....
131
132 You can stub this request with the following snippet:
133
134 stub_request(:get, "http://www.example.com/").
135 to_return(:status => 200, :body => "", :headers => {})
136
137 registered request stubs:
138
139 stub_request(:get, "http://www.example.net/")
140 stub_request(:get, "http://www.example.org/")
141
142 Thanks to [Lin Jen-Shin](https://github.com/godfat) for suggesting this feature.
3cb39d7 @bblimke Version 1.7.0.pre Changelog
authored
143
144 * 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.
145
607e1e8 @bblimke Added more examples to 1.7.0.pre Changelog
authored
146 * 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
147
148 * External requests can be disabled while allowing selected ports on selected hosts
149
150 WebMock.disable_net_connect!(:allow => "www.example.com:8080")
151 RestClient.get("www.example.com:80") # ===> Failure
152 RestClient.get("www.example.com:8080") # ===> Allowed.
153
fa61e9a @bblimke Fixed formatting in changelog
authored
154 Thanks to [Zach Dennis](https://github.com/zdennis)
3cb39d7 @bblimke Version 1.7.0.pre Changelog
authored
155
156 * Fixed syntax error in README examples, showing the ways of setting request expectations. Thanks to [Nikita Fedyashev](https://github.com/nfedyashev)
157
158
ae0286a @bblimke @jcf actually did a great job maintaining WebMock!
authored
159 **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
160
a62080b @jcf Update changelog and version number
jcf authored
161 ## 1.6.4
162
163 This is a quick slip release to regenerate the gemspec. Apparently
164 jeweler inserts dependencies twice if you use the `gemspec` method in
165 your Gemfile and declare gem dependencies in your gemspec.
166
167 https://github.com/technicalpickles/jeweler/issues/154
168
169 josevalim:
170
171 > This just bit me. I just released a gem with the wrong dependencies
172 > because I have updated jeweler. This should have been opt-in,
173 > otherwise a bunch of people using jeweler are going to release gems
174 > with the wrong dependencies because you are automatically importing
175 > from the Gemfile.
176
9887d17 @jcf Prepare for 1.6.3 release
jcf authored
177 ## 1.6.3
178
179 * Update the dependency on addressable to get around an issue in v2.2.5.
180 Thanks to [Peter Higgins](https://github.com/phiggins).
181
182 * Add support for matching parameter values using a regular expression
183 as well as a string. Thanks to [Oleg M Prozorov](https://github.com/oleg).
184
185 * Fix integration with httpclient as the internal API has changed.
186 Thanks to [Frank Prößdorf](https://github.com/endor).
187
188 * Ensure Curl::Easy#content_type is always set. Thanks to [Peter
189 Higgins](https://github.com/phiggins).
190
191 * Fix bug with em-http-request adapter stubbing responses that have a
192 chunked transfer encoding. Thanks to [Myron
193 Marston](https://github.com/myronmarston).
194
195 * Fix a load of spec failures with Patron, httpclient, and specs that
196 depended on the behaviour of example.com. Thanks to [Alex
197 Grigorovich](https://github.com/grig).
5313e02 Added version 0.9.0 features to CHANGELOG and README
Bartosz Blimke authored
198
e6af079 @bblimke Updated 1.6.2 changelog and credits
authored
199 ## 1.6.2
200
201 * Em-http-request adapter sets `last_effective_url` property. Thanks to [Sam Stokes](https://github.com/samstokes).
202
203 * 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)
204
f7b9c77 @bblimke Updated version 1.6.1 changelog
authored
205 ## 1.6.1
206
207 * Fixed issue with `webmock/rspec` which didn't load correctly if `rspec/core` was already required but `rspec/expectations` not.
208
7110c60 @bblimke Updated version 1.6.0 changelog
authored
209 ## 1.6.0
473b709 @bblimke Added WebMock.reset! method. WebMock.reset_webmock is now deprecated
authored
210
7110c60 @bblimke Updated version 1.6.0 changelog
authored
211 * 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
212
a251cb3 @jcf Indent files correctly and remove trailing whitespace
jcf authored
213 require 'webmock/test_unit'
214 require 'webmock/rspec'
215 require 'webmock/cucumber'
acaab83 @bblimke Updated changelog with the latest changes in master.
authored
216
65dd12b @bblimke Updated changelog with latest changes in master branch
authored
217 * 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.
218
e6925a2 @bblimke Updated changelog with the latest changes in master
authored
219 * The expectation failure message now contains a list of made requests. Thanks to Martyn Loughran for suggesting this feature.
220
86f36d2 @bblimke em-http-request adapter is activated by replacing EventMachine::HttpR…
authored
221 * Added `WebMock.print_executed_requests` method which can be useful to find out what requests were made until a given point.
222
7110c60 @bblimke Updated version 1.6.0 changelog
authored
223 * 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
224
7110c60 @bblimke Updated version 1.6.0 changelog
authored
225 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
226
a251cb3 @jcf Indent files correctly and remove trailing whitespace
jcf authored
227 EventMachine::WebMockHttpRequest.activate!
228 EventMachine::WebMockHttpRequest.deactivate!
86f36d2 @bblimke em-http-request adapter is activated by replacing EventMachine::HttpR…
authored
229
a251cb3 @jcf Indent files correctly and remove trailing whitespace
jcf authored
230 Thanks to Martyn Loughran for suggesting this feature.
231
232 * `WebMock.reset_webmock` is deprecated in favour of new `WebMock.reset!`
7110c60 @bblimke Updated version 1.6.0 changelog
authored
233
234 * 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
235
7110c60 @bblimke Updated version 1.6.0 changelog
authored
236 * 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
237
7110c60 @bblimke Updated version 1.6.0 changelog
authored
238 * 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
239
7110c60 @bblimke Updated version 1.6.0 changelog
authored
240 * 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
241
7bca10a @bblimke Don't use JSON to normalize hash body in request pattern. Removed dep…
authored
242 * Removed dependency on json gem
243
079a719 @bblimke Updated changelog with version 1.5.0 changes
authored
244 ## 1.5.0
f0408f8 @bblimke Added support for dynamically evaluated raw responses recorded with `…
authored
245
246 * Support for dynamically evaluated raw responses recorded with `curl -is` <br/>
247 i.e.
248
a251cb3 @jcf Indent files correctly and remove trailing whitespace
jcf authored
249 `curl -is www.example.com > /tmp/www.example.com.txt`
250 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
251
079a719 @bblimke Updated changelog with version 1.5.0 changes
authored
252 * `: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
253
a251cb3 @jcf Indent files correctly and remove trailing whitespace
jcf authored
254 WebMock.allow_net_connect!(:net_http_connect_on_start => true)
ffbcdb3 @bblimke Updated changelog with the latest changes in master branch
authored
255
079a719 @bblimke Updated changelog with version 1.5.0 changes
authored
256 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
257
079a719 @bblimke Updated changelog with version 1.5.0 changes
authored
258 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
259
079a719 @bblimke Updated changelog with version 1.5.0 changes
authored
260 * Fixed an issue where Patron spec tried to remove system temporary directory.
261 Thanks to Hans de Graaff
4e313c2 @bblimke Updated CHANGELOG and README with information about net_http_connect_…
authored
262
079a719 @bblimke Updated changelog with version 1.5.0 changes
authored
263 * WebMock specs now use RSpec 2
4e313c2 @bblimke Updated CHANGELOG and README with information about net_http_connect_…
authored
264
079a719 @bblimke Updated changelog with version 1.5.0 changes
authored
265 * `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
266
a53f1a0 @bblimke Updated CHANGELOG with version 1.4.0 changes
authored
267 ## 1.4.0
6eb8bb5 @bblimke WebMock tries to use already loaded version of RSpec (1.x or 2.x) (pr…
authored
268
aaf774b @bblimke Added info to changelog and readme about Curb support, implemented by…
authored
269 * Curb support!!! Thanks to the awesome work of Pete Higgins!
270
2328c00 @bblimke Updated Changelog with the latest changes in master
authored
271 * `include WebMock` is now deprecated to avoid method and constant name conflicts. Please `include WebMock::API` instead.
272
a251cb3 @jcf Indent files correctly and remove trailing whitespace
jcf authored
273 * `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
274 WebMock.request is still available.
275
a53f1a0 @bblimke Updated CHANGELOG with version 1.4.0 changes
authored
276 * 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
277
a53f1a0 @bblimke Updated CHANGELOG with version 1.4.0 changes
authored
278 * 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
279
c646491 @bblimke :allow_localhost => true' now permits 0.0.0.0 in addition to 127.0.0.…
authored
280 * :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.
281
a53f1a0 @bblimke Updated CHANGELOG with version 1.4.0 changes
authored
282 * 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
283
a53f1a0 @bblimke Updated CHANGELOG with version 1.4.0 changes
authored
284 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
285
286 Thanks to Hans de Graaff for reporting this.
287
9acf181 @bblimke Updated changelog for version 1.4.0
authored
288 * Changed runtime dependency on Addressable version 2.2.2 which fixes handling of percent-escaped '+'
289
67a0819 @bblimke Version 1.3.5 changelog + updated docs
authored
290 ## 1.3.5
291
292 * External requests can be disabled while allowing selected hosts. Thanks to Charles Li and Ryan Bigg
293
294 This feature was available before only for localhost with `:allow_localhost => true`
295
a251cb3 @jcf Indent files correctly and remove trailing whitespace
jcf authored
296 WebMock.disable_net_connect!(:allow => "www.example.org")
67a0819 @bblimke Version 1.3.5 changelog + updated docs
authored
297
a251cb3 @jcf Indent files correctly and remove trailing whitespace
jcf authored
298 Net::HTTP.get('www.something.com', '/') # ===> Failure
67a0819 @bblimke Version 1.3.5 changelog + updated docs
authored
299
a251cb3 @jcf Indent files correctly and remove trailing whitespace
jcf authored
300 Net::HTTP.get('www.example.org', '/') # ===> Allowed.
67a0819 @bblimke Version 1.3.5 changelog + updated docs
authored
301
302 * Fixed Net::HTTP adapter so that it preserves the original behavior of Net::HTTP.
303
304 When making a request with a block that calls #read_body on the request,
305 Net::HTTP causes the body to be set to a Net::ReadAdapter, but WebMock was causing the body to be set to a string.
306
688e687 Version 1.3.4 changelog
Bartosz Blimke and Oliver Nightingale authored
307 ## 1.3.4
308
309 * Fixed Net::HTTP adapter to handle cases where a block with `read_body` call is passed to `request`.
310 This fixes compatibility with `open-uri`. Thanks to Mark Evans for reporting the issue.
311
db5fcf4 Version 1.3.3 changelog.
Bartosz Blimke and Ben Pickles authored
312 ## 1.3.3
313
314 * Fixed handling of multiple values for the same response header for Net::HTTP. Thanks to Myron Marston for reporting the issue.
315
27c0f65 Version 1.3.2 changelog
Bartosz Blimke and Ben Pickles authored
316 ## 1.3.2
317
318 * Fixed compatibility with EM-HTTP-Request >= 0.2.9. Thanks to Myron Marston for reporting the issue.
319
15f888e @bblimke The less hacky way to get the stream behaviour working for em-http-re…
authored
320 ## 1.3.1
321
60fa244 @bblimke Updated changelog
authored
322 * The less hacky way to get the stream behaviour working for em-http-request. Thanks to Martyn Loughran
323
324 * 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
325
354af66 Updated CHANGELOG width version 1.3.0 changes
Bartosz Blimke authored
326 ## 1.3.0
327
328 * Added support for [em-http-request](http://github.com/igrigorik/em-http-request)
329
a251cb3 @jcf Indent files correctly and remove trailing whitespace
jcf authored
330 * Matching query params using a hash
331
332 stub_http_request(:get, "www.example.com").with(:query => {"a" => ["b", "c"]})
333
334 RestClient.get("http://www.example.com/?a[]=b&a[]=c") # ===> Success
354af66 Updated CHANGELOG width version 1.3.0 changes
Bartosz Blimke authored
335
a251cb3 @jcf Indent files correctly and remove trailing whitespace
jcf authored
336 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
337
338 * 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
339
354af66 Updated CHANGELOG width version 1.3.0 changes
Bartosz Blimke authored
340 (Thanks to Steve Tooke for the idea and a solution for url-encoded bodies)
341
a251cb3 @jcf Indent files correctly and remove trailing whitespace
jcf authored
342 stub_http_request(:post, "www.example.com").
343 with(:body => {:data => {:a => '1', :b => 'five'}})
344
345 RestClient.post('www.example.com', "data[a]=1&data[b]=five",
346 :content_type => 'application/x-www-form-urlencoded') # ===> Success
347
348 RestClient.post('www.example.com', '{"data":{"a":"1","b":"five"}}',
349 :content_type => 'application/json') # ===> Success
350
351 RestClient.post('www.example.com', '<data a="1" b="five" />',
352 :content_type => 'application/xml' ) # ===> Success
353
354 request(:post, "www.example.com").
355 with(:body => {:data => {:a => '1', :b => 'five'}},
356 :headers => 'Content-Type' => 'application/json').should have_been_made # ===> Success
354af66 Updated CHANGELOG width version 1.3.0 changes
Bartosz Blimke authored
357
358 * Request callbacks (Thanks to Myron Marston for all suggestions)
359
360 WebMock can now invoke callbacks for stubbed or real requests:
361
a251cb3 @jcf Indent files correctly and remove trailing whitespace
jcf authored
362 WebMock.after_request do |request_signature, response|
363 puts "Request #{request_signature} was made and #{response} was returned"
364 end
365
354af66 Updated CHANGELOG width version 1.3.0 changes
Bartosz Blimke authored
366 invoke callbacks for real requests only and except requests made with Patron client
367
a251cb3 @jcf Indent files correctly and remove trailing whitespace
jcf authored
368 WebMock.after_request(:except => [:patron], :real_requests_only => true) do |request_signature, response|
369 puts "Request #{request_signature} was made and #{response} was returned"
370 end
354af66 Updated CHANGELOG width version 1.3.0 changes
Bartosz Blimke authored
371
372 * `to_raise()` now accepts an exception instance or a string as argument in addition to an exception class
373
a251cb3 @jcf Indent files correctly and remove trailing whitespace
jcf authored
374 stub_request(:any, 'www.example.net').to_raise(StandardError.new("some error"))
375
376 stub_request(:any, 'www.example.net').to_raise("some error")
354af66 Updated CHANGELOG width version 1.3.0 changes
Bartosz Blimke authored
377
26cb92f Small improvements to CHANGELOG for version 1.3.0
Bartosz Blimke authored
378 * Matching requests based on a URI is 30% faster
354af66 Updated CHANGELOG width version 1.3.0 changes
Bartosz Blimke authored
379
380 * Fixed constant namespace issues in HTTPClient adapter. Thanks to Nathaniel Bibler for submitting a patch.
381
fd2472a Version 1.2.2 changelog
Bartosz Blimke authored
382 ## 1.2.2
383
384 * 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
385
5803f31 Version bump to 1.2.1
Bartosz Blimke authored
386 ## 1.2.1
387
388 * Changed license from GPL to MIT
389
390 * Fixed gemspec file. Thanks to Razic
391
a251cb3 @jcf Indent files correctly and remove trailing whitespace
jcf authored
392 ## 1.2.0
31b3ffb Added version 1.2.0 changelog
Bartosz Blimke authored
393
394 * RSpec 2 compatibility. Thanks to Sam Phillips!
395
396 * :allow_localhost => true' now permits 127.0.0.1 as well as 'localhost'. Thanks to Mack Earnhardt
397
398 * Request URI matching in now 2x faster!
399
400
4a04017 Added 1.1.0 changelog
Bartosz Blimke authored
401 ## 1.1.0
402
ee7b3b4 Fixed spelling
Bartosz Blimke authored
403 * [VCR](http://github.com/myronmarston/vcr/) compatibility. Many thanks to Myron Marston for all suggestions.
4a04017 Added 1.1.0 changelog
Bartosz Blimke authored
404
a251cb3 @jcf Indent files correctly and remove trailing whitespace
jcf authored
405 * Support for stubbing requests and returning responses with multiple headers with the same name. i.e multiple Accept headers.
406
407 stub_http_request(:get, 'www.example.com').
408 with(:headers => {'Accept' => ['image/png', 'image/jpeg']}).
409 to_return(:body => 'abc')
410 RestClient.get('www.example.com',
411 {"Accept" => ['image/png', 'image/jpeg']}) # ===> "abc\n"
4a04017 Added 1.1.0 changelog
Bartosz Blimke authored
412
413 * When real net connections are disabled and unstubbed request is made, WebMock throws WebMock::NetConnectNotAllowedError instead of assertion error or StandardError.
414
415 * Added WebMock.version()
416
417
66519c1 Updated changelog with 1.0.0 changes
Bartosz Blimke authored
418 ## 1.0.0
419
420 * Added support for [Patron](http://toland.github.com/patron/)
421
422 * Responses dynamically evaluated from block (idea and implementation by Tom Ward)
423
a251cb3 @jcf Indent files correctly and remove trailing whitespace
jcf authored
424 stub_request(:any, 'www.example.net').
425 to_return { |request| {:body => request.body} }
66519c1 Updated changelog with 1.0.0 changes
Bartosz Blimke authored
426
a251cb3 @jcf Indent files correctly and remove trailing whitespace
jcf authored
427 RestClient.post('www.example.net', 'abc') # ===> "abc\n"
66519c1 Updated changelog with 1.0.0 changes
Bartosz Blimke authored
428
429 * Responses dynamically evaluated from lambda (idea and implementation by Tom Ward)
430
a251cb3 @jcf Indent files correctly and remove trailing whitespace
jcf authored
431 stub_request(:any, 'www.example.net').
432 to_return(lambda { |request| {:body => request.body} })
66519c1 Updated changelog with 1.0.0 changes
Bartosz Blimke authored
433
a251cb3 @jcf Indent files correctly and remove trailing whitespace
jcf authored
434 RestClient.post('www.example.net', 'abc') # ===> "abc\n"
66519c1 Updated changelog with 1.0.0 changes
Bartosz Blimke authored
435
a251cb3 @jcf Indent files correctly and remove trailing whitespace
jcf authored
436 * Response with custom status message
66519c1 Updated changelog with 1.0.0 changes
Bartosz Blimke authored
437
a251cb3 @jcf Indent files correctly and remove trailing whitespace
jcf authored
438 stub_request(:any, "www.example.com").to_return(:status => [500, "Internal Server Error"])
66519c1 Updated changelog with 1.0.0 changes
Bartosz Blimke authored
439
a251cb3 @jcf Indent files correctly and remove trailing whitespace
jcf authored
440 req = Net::HTTP::Get.new("/")
441 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
442
c3c92ba Added information about allowing localhost to version 1.0.0 changelog
Bartosz Blimke authored
443 * 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
444
a251cb3 @jcf Indent files correctly and remove trailing whitespace
jcf authored
445 stub_request(:any, 'www.example.net').to_timeout
66519c1 Updated changelog with 1.0.0 changes
Bartosz Blimke authored
446
a251cb3 @jcf Indent files correctly and remove trailing whitespace
jcf authored
447 RestClient.post('www.example.net', 'abc') # ===> RestClient::RequestTimeout
66519c1 Updated changelog with 1.0.0 changes
Bartosz Blimke authored
448
c3c92ba Added information about allowing localhost to version 1.0.0 changelog
Bartosz Blimke authored
449 * External requests can be disabled while allowing localhost (idea and implementation by Mack Earnhardt)
450
a251cb3 @jcf Indent files correctly and remove trailing whitespace
jcf authored
451 WebMock.disable_net_connect!(:allow_localhost => true)
c3c92ba Added information about allowing localhost to version 1.0.0 changelog
Bartosz Blimke authored
452
a251cb3 @jcf Indent files correctly and remove trailing whitespace
jcf authored
453 Net::HTTP.get('www.something.com', '/') # ===> Failure
c3c92ba Added information about allowing localhost to version 1.0.0 changelog
Bartosz Blimke authored
454
a251cb3 @jcf Indent files correctly and remove trailing whitespace
jcf authored
455 Net::HTTP.get('localhost:9887', '/') # ===> Allowed. Perhaps to Selenium?
c3c92ba Added information about allowing localhost to version 1.0.0 changelog
Bartosz Blimke authored
456
457
66519c1 Updated changelog with 1.0.0 changes
Bartosz Blimke authored
458 ### Bug fixes
459
460 * 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
461 * 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
462
b6c3b3b Version bump to 0.9.1
Bartosz Blimke authored
463 ## 0.9.1
464
465 * Fixed issue where response status code was not read from raw (curl -is) responses
466
5313e02 Added version 0.9.0 features to CHANGELOG and README
Bartosz Blimke authored
467 ## 0.9.0
a251cb3 @jcf Indent files correctly and remove trailing whitespace
jcf authored
468
5313e02 Added version 0.9.0 features to CHANGELOG and README
Bartosz Blimke authored
469 * Matching requests against provided block (by Sergio Gil)
470
a251cb3 @jcf Indent files correctly and remove trailing whitespace
jcf authored
471 stub_request(:post, "www.example.com").with { |request| request.body == "abc" }.to_return(:body => "def")
472 RestClient.post('www.example.com', 'abc') # ===> "def\n"
473 request(:post, "www.example.com").with { |req| req.body == "abc" }.should have_been_made
474 #or
475 assert_requested(:post, "www.example.com") { |req| req.body == "abc" }
5313e02 Added version 0.9.0 features to CHANGELOG and README
Bartosz Blimke authored
476
66519c1 Updated changelog with 1.0.0 changes
Bartosz Blimke authored
477 * Matching request body against regular expressions (suggested by Ben Pickles)
5313e02 Added version 0.9.0 features to CHANGELOG and README
Bartosz Blimke authored
478
a251cb3 @jcf Indent files correctly and remove trailing whitespace
jcf authored
479 stub_request(:post, "www.example.com").with(:body => /^.*world$/).to_return(:body => "abc")
480 RestClient.post('www.example.com', 'hello world') # ===> "abc\n"
481
66519c1 Updated changelog with 1.0.0 changes
Bartosz Blimke authored
482 * Matching request headers against regular expressions (suggested by Ben Pickles)
5313e02 Added version 0.9.0 features to CHANGELOG and README
Bartosz Blimke authored
483
a251cb3 @jcf Indent files correctly and remove trailing whitespace
jcf authored
484 stub_request(:post, "www.example.com").with(:headers => {"Content-Type" => /image\/.+/}).to_return(:body => "abc")
485 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
486
487 * Replaying raw responses recorded with `curl -is`
488
a251cb3 @jcf Indent files correctly and remove trailing whitespace
jcf authored
489 `curl -is www.example.com > /tmp/example_curl_-is_output.txt`
490 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
491
a251cb3 @jcf Indent files correctly and remove trailing whitespace
jcf authored
492 from file
493
494 stub_request(:get, "www.example.com").to_return(raw_response_file)
495
496 or string
497
498 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
499
500 * Multiple responses for repeated requests
501
a251cb3 @jcf Indent files correctly and remove trailing whitespace
jcf authored
502 stub_request(:get, "www.example.com").to_return({:body => "abc"}, {:body => "def"})
503 Net::HTTP.get('www.example.com', '/') # ===> "abc\n"
504 Net::HTTP.get('www.example.com', '/') # ===> "def\n"
5313e02 Added version 0.9.0 features to CHANGELOG and README
Bartosz Blimke authored
505
506 * Multiple responses using chained `to_return()` or `to_raise()` declarations
507
a251cb3 @jcf Indent files correctly and remove trailing whitespace
jcf authored
508 stub_request(:get, "www.example.com").
509 to_return({:body => "abc"}).then. #then() just is a syntactic sugar
510 to_return({:body => "def"}).then.
511 to_raise(MyException)
512 Net::HTTP.get('www.example.com', '/') # ===> "abc\n"
513 Net::HTTP.get('www.example.com', '/') # ===> "def\n"
514 Net::HTTP.get('www.example.com', '/') # ===> MyException raised
515
5313e02 Added version 0.9.0 features to CHANGELOG and README
Bartosz Blimke authored
516 * Specifying number of times given response should be returned
517
a251cb3 @jcf Indent files correctly and remove trailing whitespace
jcf authored
518 stub_request(:get, "www.example.com").
519 to_return({:body => "abc"}).times(2).then.
520 to_return({:body => "def"})
521
522 Net::HTTP.get('www.example.com', '/') # ===> "abc\n"
523 Net::HTTP.get('www.example.com', '/') # ===> "abc\n"
524 Net::HTTP.get('www.example.com', '/') # ===> "def\n"
525
5313e02 Added version 0.9.0 features to CHANGELOG and README
Bartosz Blimke authored
526 * Added support for `Net::HTTP::Post#body_stream`
527
a251cb3 @jcf Indent files correctly and remove trailing whitespace
jcf authored
528 This fixes compatibility with new versions of RestClient
529
5313e02 Added version 0.9.0 features to CHANGELOG and README
Bartosz Blimke authored
530 * WebMock doesn't suppress default request headers added by http clients anymore.
531
a251cb3 @jcf Indent files correctly and remove trailing whitespace
jcf authored
532 i.e. Net::HTTP adds `'Accept'=>'*/*'` to all requests by default
533
534
535
5313e02 Added version 0.9.0 features to CHANGELOG and README
Bartosz Blimke authored
536 ## 0.8.2
a251cb3 @jcf Indent files correctly and remove trailing whitespace
jcf authored
537
5313e02 Added version 0.9.0 features to CHANGELOG and README
Bartosz Blimke authored
538 * Fixed issue where WebMock was not closing IO object passed as response body after reading it.
539 * 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
540
541
542 ## 0.8.1
a251cb3 @jcf Indent files correctly and remove trailing whitespace
jcf authored
543
5313e02 Added version 0.9.0 features to CHANGELOG and README
Bartosz Blimke authored
544 * Fixed HTTPClient adapter compatibility with Ruby 1.8.6 (reported by Piotr Usewicz)
545 * Net:HTTP adapter now handles request body assigned as Net::HTTP::Post#body attribute (fixed by Mack Earnhardt)
546 * Fixed issue where requests were not matching stubs with Accept header set.(reported by Piotr Usewicz)
547 * Fixed compatibility with Ruby 1.9.1, 1.9.2 and JRuby 1.3.1 (reported by Diego E. “Flameeyes” Pettenò)
548 * Fixed issue with response body declared as IO object and multiple requests (reported by Niels Meersschaert)
549 * Fixed "undefined method `assertion_failure'" error (reported by Nick Plante)
550
551
552 ## 0.8.0
553
554 * Support for HTTPClient (sync and async requests)
a251cb3 @jcf Indent files correctly and remove trailing whitespace
jcf authored
555 * Support for dynamic responses. Response body and headers can be now declared as lambda.
556 (Thanks to Ivan Vega ( @ivanyv ) for suggesting this feature)
5313e02 Added version 0.9.0 features to CHANGELOG and README
Bartosz Blimke authored
557 * Support for stubbing and expecting requests with empty body
558 * Executing non-stubbed request leads to failed expectation instead of error
559
560
561 ### Bug fixes
562
563 * Basic authentication now works correctly
564 * Fixed problem where WebMock didn't call a block with the response when block was provided
565 * Fixed problem where uris with single slash were not matching uris without path provided
566
567
568 ## 0.7.3
569
570 * Clarified documentation
571 * Fixed some issues with loading of Webmock classes
572 * Test::Unit and RSpec adapters have to be required separately
573
574
575 ## 0.7.2
576
577 * Added support for matching escaped and non escaped URLs
Something went wrong with that request. Please try again.