Skip to content
This repository
Newer
Older
100644 481 lines (278 sloc) 20.671 kb
9887d174 »
2011-05-18 Prepare for 1.6.3 release
1 # Changelog
2
3cb39d76 »
2011-08-09 Version 1.7.0.pre Changelog
3 ## 1.7.0.pre
4
5 * Fixed Net::HTTP adapter to not break normal Net::HTTP behaviour when network connections are allowed. This fixes selenium-webdriver compatibility!!!
6
7 * Added support for em-http-request 1.0.x and em-synchrony. Thanks to [Steve Hull](https://github.com/sdhull)
8
9 * Added support for setting expectations to on a stub itself i.e.
10
11 stub = stub_request(:get, "www.example.com")
12 # ... make requests ...
13 stub.should have_been_requested
14
15 Thanks to [Aidan Feldman](https://github.com/afeld)
16
17 * Minitest support! Thanks to [Peter Higgins](https://github.com/phiggins)
18
21aba845 »
2011-08-09 Updated README and Changelog with inf about Typhoeus support
19 * Added support for Typhoeus::Hydra
20
3cb39d76 »
2011-08-09 Version 1.7.0.pre Changelog
21 * 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)
22
23 * Rack support. Requests can be stubbed to respond with a Rack app i.e.
24
25 class MyRackApp
26 def self.call(env)
27 [200, {}, ["Hello"]]
28 end
29 end
30
31 stub_request(:get, "www.example.com").to_rack(MyRackApp)
32
fa61e9ad »
2011-08-09 Fixed formatting in changelog
33 Thanks to [Jay Adkisson](https://github.com/jayferd)
3cb39d76 »
2011-08-09 Version 1.7.0.pre Changelog
34
17547a56 »
2011-08-14 Updated Changelog and README with info about enabling and disabling W…
35 * Added support for selective disabling and enabling of http client adapters
36
37 WebMock.disable! #disable WebMock (all adapters)
38 WebMock.disable!(:except => [:net_http]) #disable all adapters except Net::HTTP
39 WebMock.enable! #enable WebMock (all adapters)
40 WebMock.enable!(:except => [:patron]) #enable all adapters except Patron
41
3cb39d76 »
2011-08-09 Version 1.7.0.pre Changelog
42 * The error message on an unstubbed request shows a code snippet with body as a hash when it was in url encoded form. Thanks to [Alex Rothenberg](https://github.com/alexrothenberg)
43
fa61e9ad »
2011-08-09 Fixed formatting in changelog
44 * The error message on an unstubbed request shows currently registered request stubs.
45 Thanks to [Lin Jen-Shin](https://github.com/godfat) for suggesting this feature.
3cb39d76 »
2011-08-09 Version 1.7.0.pre Changelog
46
47 * 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.
48
49 * WebMock now attempts to require each http library before monkey patching it. Thanks to [Myron Marston](https://github.com/myronmarston) for suggesting this change.
50
51 * External requests can be disabled while allowing selected ports on selected hosts
52
53 WebMock.disable_net_connect!(:allow => "www.example.com:8080")
54 RestClient.get("www.example.com:80") # ===> Failure
55 RestClient.get("www.example.com:8080") # ===> Allowed.
56
fa61e9ad »
2011-08-09 Fixed formatting in changelog
57 Thanks to [Zach Dennis](https://github.com/zdennis)
3cb39d76 »
2011-08-09 Version 1.7.0.pre Changelog
58
59 * Fixed syntax error in README examples, showing the ways of setting request expectations. Thanks to [Nikita Fedyashev](https://github.com/nfedyashev)
60
61
ae0286a7 »
2011-08-09 @jcf actually did a great job maintaining WebMock!
62 **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.**
3cb39d76 »
2011-08-09 Version 1.7.0.pre Changelog
63
a62080b5 »
2011-05-18 Update changelog and version number
64 ## 1.6.4
65
66 This is a quick slip release to regenerate the gemspec. Apparently
67 jeweler inserts dependencies twice if you use the `gemspec` method in
68 your Gemfile and declare gem dependencies in your gemspec.
69
70 https://github.com/technicalpickles/jeweler/issues/154
71
72 josevalim:
73
74 > This just bit me. I just released a gem with the wrong dependencies
75 > because I have updated jeweler. This should have been opt-in,
76 > otherwise a bunch of people using jeweler are going to release gems
77 > with the wrong dependencies because you are automatically importing
78 > from the Gemfile.
79
9887d174 »
2011-05-18 Prepare for 1.6.3 release
80 ## 1.6.3
81
82 * Update the dependency on addressable to get around an issue in v2.2.5.
83 Thanks to [Peter Higgins](https://github.com/phiggins).
84
85 * Add support for matching parameter values using a regular expression
86 as well as a string. Thanks to [Oleg M Prozorov](https://github.com/oleg).
87
88 * Fix integration with httpclient as the internal API has changed.
89 Thanks to [Frank Prößdorf](https://github.com/endor).
90
91 * Ensure Curl::Easy#content_type is always set. Thanks to [Peter
92 Higgins](https://github.com/phiggins).
93
94 * Fix bug with em-http-request adapter stubbing responses that have a
95 chunked transfer encoding. Thanks to [Myron
96 Marston](https://github.com/myronmarston).
97
98 * Fix a load of spec failures with Patron, httpclient, and specs that
99 depended on the behaviour of example.com. Thanks to [Alex
100 Grigorovich](https://github.com/grig).
5313e02f »
2010-01-31 Added version 0.9.0 features to CHANGELOG and README
101
e6af079b »
2011-01-12 Updated 1.6.2 changelog and credits
102 ## 1.6.2
103
104 * Em-http-request adapter sets `last_effective_url` property. Thanks to [Sam Stokes](https://github.com/samstokes).
105
106 * 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)
107
f7b9c77e »
2010-11-13 Updated version 1.6.1 changelog
108 ## 1.6.1
109
110 * Fixed issue with `webmock/rspec` which didn't load correctly if `rspec/core` was already required but `rspec/expectations` not.
111
7110c60f »
2010-11-12 Updated version 1.6.0 changelog
112 ## 1.6.0
473b7096 »
2010-11-03 Added WebMock.reset! method. WebMock.reset_webmock is now deprecated
113
7110c60f »
2010-11-12 Updated version 1.6.0 changelog
114 * Simplified integration with Test::Unit, RSpec and Cucumber. Now only a single file has to be required i.e.
acaab83e »
2010-11-03 Updated changelog with the latest changes in master.
115
a251cb36 »
2011-05-28 Indent files correctly and remove trailing whitespace
116 require 'webmock/test_unit'
117 require 'webmock/rspec'
118 require 'webmock/cucumber'
acaab83e »
2010-11-03 Updated changelog with the latest changes in master.
119
65dd12b5 »
2010-11-10 Updated changelog with latest changes in master branch
120 * 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.
121
e6925a22 »
2010-11-11 Updated changelog with the latest changes in master
122 * The expectation failure message now contains a list of made requests. Thanks to Martyn Loughran for suggesting this feature.
123
86f36d2d »
2010-11-11 em-http-request adapter is activated by replacing EventMachine::HttpR…
124 * Added `WebMock.print_executed_requests` method which can be useful to find out what requests were made until a given point.
125
7110c60f »
2010-11-12 Updated version 1.6.0 changelog
126 * em-http-request adapter is now activated by replacing EventMachine::HttpRequest constant, instead of monkeypatching the original class.
86f36d2d »
2010-11-11 em-http-request adapter is activated by replacing EventMachine::HttpR…
127
7110c60f »
2010-11-12 Updated version 1.6.0 changelog
128 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:
86f36d2d »
2010-11-11 em-http-request adapter is activated by replacing EventMachine::HttpR…
129
a251cb36 »
2011-05-28 Indent files correctly and remove trailing whitespace
130 EventMachine::WebMockHttpRequest.activate!
131 EventMachine::WebMockHttpRequest.deactivate!
86f36d2d »
2010-11-11 em-http-request adapter is activated by replacing EventMachine::HttpR…
132
a251cb36 »
2011-05-28 Indent files correctly and remove trailing whitespace
133 Thanks to Martyn Loughran for suggesting this feature.
134
135 * `WebMock.reset_webmock` is deprecated in favour of new `WebMock.reset!`
7110c60f »
2010-11-12 Updated version 1.6.0 changelog
136
137 * Fixed integration with Cucumber. Previously documented example didn't work with new versions of Cucumber.
72cd989d »
2010-11-11 Added WebMock.print_executed_requests method which can be useful to f…
138
7110c60f »
2010-11-12 Updated version 1.6.0 changelog
139 * Fixed stubbing requests with body declared as a hash. Thanks to Erik Michaels-Ober for reporting the issue.
a7cb4fa5 »
2010-11-05 Fixed issue with stubbing requests with request body declared as a ha…
140
7110c60f »
2010-11-12 Updated version 1.6.0 changelog
141 * 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.
178bfd1c »
2010-11-07 em-http-request adapter now works correctly when :query option value …
142
7110c60f »
2010-11-12 Updated version 1.6.0 changelog
143 * Fixed problem with assert_requested which didn't work if used outside rspec or test/unit
473b7096 »
2010-11-03 Added WebMock.reset! method. WebMock.reset_webmock is now deprecated
144
7bca10a3 »
2010-11-08 Don't use JSON to normalize hash body in request pattern. Removed dep…
145 * Removed dependency on json gem
146
079a719e »
2010-11-02 Updated changelog with version 1.5.0 changes
147 ## 1.5.0
f0408f85 »
2010-10-25 Added support for dynamically evaluated raw responses recorded with `…
148
149 * Support for dynamically evaluated raw responses recorded with `curl -is` <br/>
150 i.e.
151
a251cb36 »
2011-05-28 Indent files correctly and remove trailing whitespace
152 `curl -is www.example.com > /tmp/www.example.com.txt`
153 stub_request(:get, "www.example.com").to_return(lambda { |request| File.new("/tmp/#{request.uri.host.to_s}.txt" }))
f0408f85 »
2010-10-25 Added support for dynamically evaluated raw responses recorded with `…
154
079a719e »
2010-11-02 Updated changelog with version 1.5.0 changes
155 * `:net_http_connect_on_start` option can be passed to `WebMock.allow_net_connect!` and `WebMock.disable_net_connect!` methods, i.e.
ffbcdb3c »
2010-10-30 Updated changelog with the latest changes in master branch
156
a251cb36 »
2011-05-28 Indent files correctly and remove trailing whitespace
157 WebMock.allow_net_connect!(:net_http_connect_on_start => true)
ffbcdb3c »
2010-10-30 Updated changelog with the latest changes in master branch
158
079a719e »
2010-11-02 Updated changelog with version 1.5.0 changes
159 This forces WebMock Net::HTTP adapter to always connect on `Net::HTTP.start`. Check 'Connecting on Net::HTTP.start' in README for more information.
ffbcdb3c »
2010-10-30 Updated changelog with the latest changes in master branch
160
079a719e »
2010-11-02 Updated changelog with version 1.5.0 changes
161 Thanks to Alastair Brunton for reporting the issue and for fix suggestions.
4e313c29 »
2010-11-02 Updated CHANGELOG and README with information about net_http_connect_…
162
079a719e »
2010-11-02 Updated changelog with version 1.5.0 changes
163 * Fixed an issue where Patron spec tried to remove system temporary directory.
164 Thanks to Hans de Graaff
4e313c29 »
2010-11-02 Updated CHANGELOG and README with information about net_http_connect_…
165
079a719e »
2010-11-02 Updated changelog with version 1.5.0 changes
166 * WebMock specs now use RSpec 2
4e313c29 »
2010-11-02 Updated CHANGELOG and README with information about net_http_connect_…
167
079a719e »
2010-11-02 Updated changelog with version 1.5.0 changes
168 * `rake spec NO_CONNECTION=true` can now be used to only run WebMock specs which do not make real network connections
4e313c29 »
2010-11-02 Updated CHANGELOG and README with information about net_http_connect_…
169
a53f1a0b »
2010-10-11 Updated CHANGELOG with version 1.4.0 changes
170 ## 1.4.0
6eb8bb50 »
2010-10-03 WebMock tries to use already loaded version of RSpec (1.x or 2.x) (pr…
171
aaf774b6 »
2010-10-04 Added info to changelog and readme about Curb support, implemented by…
172 * Curb support!!! Thanks to the awesome work of Pete Higgins!
173
2328c005 »
2010-10-10 Updated Changelog with the latest changes in master
174 * `include WebMock` is now deprecated to avoid method and constant name conflicts. Please `include WebMock::API` instead.
175
a251cb36 »
2011-05-28 Indent files correctly and remove trailing whitespace
176 * `WebMock::API#request` is renamed to `WebMock::API#a_request` to prevent method name conflicts with i.e. Rails controller specs.
2328c005 »
2010-10-10 Updated Changelog with the latest changes in master
177 WebMock.request is still available.
178
a53f1a0b »
2010-10-11 Updated CHANGELOG with version 1.4.0 changes
179 * 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.
9fded754 »
2010-10-10 Updated CHANGELOG with more detailed information on changes in master
180
a53f1a0b »
2010-10-11 Updated CHANGELOG with version 1.4.0 changes
181 * Removed `WebMock.response_for_request` and `WebMock.assertion_failure` which were only used internally and were not documented.
9fded754 »
2010-10-10 Updated CHANGELOG with more detailed information on changes in master
182
c646491e »
2010-10-03 :allow_localhost => true' now permits 0.0.0.0 in addition to 127.0.0.…
183 * :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.
184
a53f1a0b »
2010-10-11 Updated CHANGELOG with version 1.4.0 changes
185 * Fixed issue with both RSpec 1.x and 2.x being available.
6eb8bb50 »
2010-10-03 WebMock tries to use already loaded version of RSpec (1.x or 2.x) (pr…
186
a53f1a0b »
2010-10-11 Updated CHANGELOG with version 1.4.0 changes
187 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.
6eb8bb50 »
2010-10-03 WebMock tries to use already loaded version of RSpec (1.x or 2.x) (pr…
188
189 Thanks to Hans de Graaff for reporting this.
190
9acf181c »
2010-10-13 Updated changelog for version 1.4.0
191 * Changed runtime dependency on Addressable version 2.2.2 which fixes handling of percent-escaped '+'
192
67a08191 »
2010-09-06 Version 1.3.5 changelog + updated docs
193 ## 1.3.5
194
195 * External requests can be disabled while allowing selected hosts. Thanks to Charles Li and Ryan Bigg
196
197 This feature was available before only for localhost with `:allow_localhost => true`
198
a251cb36 »
2011-05-28 Indent files correctly and remove trailing whitespace
199 WebMock.disable_net_connect!(:allow => "www.example.org")
67a08191 »
2010-09-06 Version 1.3.5 changelog + updated docs
200
a251cb36 »
2011-05-28 Indent files correctly and remove trailing whitespace
201 Net::HTTP.get('www.something.com', '/') # ===> Failure
67a08191 »
2010-09-06 Version 1.3.5 changelog + updated docs
202
a251cb36 »
2011-05-28 Indent files correctly and remove trailing whitespace
203 Net::HTTP.get('www.example.org', '/') # ===> Allowed.
67a08191 »
2010-09-06 Version 1.3.5 changelog + updated docs
204
205 * Fixed Net::HTTP adapter so that it preserves the original behavior of Net::HTTP.
206
207 When making a request with a block that calls #read_body on the request,
208 Net::HTTP causes the body to be set to a Net::ReadAdapter, but WebMock was causing the body to be set to a string.
209
688e6873 »
2010-08-10 Version 1.3.4 changelog
210 ## 1.3.4
211
212 * Fixed Net::HTTP adapter to handle cases where a block with `read_body` call is passed to `request`.
213 This fixes compatibility with `open-uri`. Thanks to Mark Evans for reporting the issue.
214
db5fcf46 »
2010-08-03 Version 1.3.3 changelog.
215 ## 1.3.3
216
217 * Fixed handling of multiple values for the same response header for Net::HTTP. Thanks to Myron Marston for reporting the issue.
218
27c0f653 »
2010-07-23 Version 1.3.2 changelog
219 ## 1.3.2
220
221 * Fixed compatibility with EM-HTTP-Request >= 0.2.9. Thanks to Myron Marston for reporting the issue.
222
15f888ee »
2010-07-09 The less hacky way to get the stream behaviour working for em-http-re…
223 ## 1.3.1
224
60fa2445 »
2010-07-09 Updated changelog
225 * The less hacky way to get the stream behaviour working for em-http-request. Thanks to Martyn Loughran
226
227 * Fixed issues where Net::HTTP was not accepting valid nil response body. Thanks to Muness Alrubaie
15f888ee »
2010-07-09 The less hacky way to get the stream behaviour working for em-http-re…
228
354af66a »
2010-06-21 Updated CHANGELOG width version 1.3.0 changes
229 ## 1.3.0
230
231 * Added support for [em-http-request](http://github.com/igrigorik/em-http-request)
232
a251cb36 »
2011-05-28 Indent files correctly and remove trailing whitespace
233 * Matching query params using a hash
234
235 stub_http_request(:get, "www.example.com").with(:query => {"a" => ["b", "c"]})
236
237 RestClient.get("http://www.example.com/?a[]=b&a[]=c") # ===> Success
354af66a »
2010-06-21 Updated CHANGELOG width version 1.3.0 changes
238
a251cb36 »
2011-05-28 Indent files correctly and remove trailing whitespace
239 request(:get, "www.example.com").with(:query => {"a" => ["b", "c"]}).should have_been_made # ===> Success
354af66a »
2010-06-21 Updated CHANGELOG width version 1.3.0 changes
240
241 * Matching request body against a hash. Body can be URL-Encoded, JSON or XML.
26cb92fe »
2010-06-21 Small improvements to CHANGELOG for version 1.3.0
242
354af66a »
2010-06-21 Updated CHANGELOG width version 1.3.0 changes
243 (Thanks to Steve Tooke for the idea and a solution for url-encoded bodies)
244
a251cb36 »
2011-05-28 Indent files correctly and remove trailing whitespace
245 stub_http_request(:post, "www.example.com").
246 with(:body => {:data => {:a => '1', :b => 'five'}})
247
248 RestClient.post('www.example.com', "data[a]=1&data[b]=five",
249 :content_type => 'application/x-www-form-urlencoded') # ===> Success
250
251 RestClient.post('www.example.com', '{"data":{"a":"1","b":"five"}}',
252 :content_type => 'application/json') # ===> Success
253
254 RestClient.post('www.example.com', '<data a="1" b="five" />',
255 :content_type => 'application/xml' ) # ===> Success
256
257 request(:post, "www.example.com").
258 with(:body => {:data => {:a => '1', :b => 'five'}},
259 :headers => 'Content-Type' => 'application/json').should have_been_made # ===> Success
354af66a »
2010-06-21 Updated CHANGELOG width version 1.3.0 changes
260
261 * Request callbacks (Thanks to Myron Marston for all suggestions)
262
263 WebMock can now invoke callbacks for stubbed or real requests:
264
a251cb36 »
2011-05-28 Indent files correctly and remove trailing whitespace
265 WebMock.after_request do |request_signature, response|
266 puts "Request #{request_signature} was made and #{response} was returned"
267 end
268
354af66a »
2010-06-21 Updated CHANGELOG width version 1.3.0 changes
269 invoke callbacks for real requests only and except requests made with Patron client
270
a251cb36 »
2011-05-28 Indent files correctly and remove trailing whitespace
271 WebMock.after_request(:except => [:patron], :real_requests_only => true) do |request_signature, response|
272 puts "Request #{request_signature} was made and #{response} was returned"
273 end
354af66a »
2010-06-21 Updated CHANGELOG width version 1.3.0 changes
274
275 * `to_raise()` now accepts an exception instance or a string as argument in addition to an exception class
276
a251cb36 »
2011-05-28 Indent files correctly and remove trailing whitespace
277 stub_request(:any, 'www.example.net').to_raise(StandardError.new("some error"))
278
279 stub_request(:any, 'www.example.net').to_raise("some error")
354af66a »
2010-06-21 Updated CHANGELOG width version 1.3.0 changes
280
26cb92fe »
2010-06-21 Small improvements to CHANGELOG for version 1.3.0
281 * Matching requests based on a URI is 30% faster
354af66a »
2010-06-21 Updated CHANGELOG width version 1.3.0 changes
282
283 * Fixed constant namespace issues in HTTPClient adapter. Thanks to Nathaniel Bibler for submitting a patch.
284
fd2472a8 »
2010-05-26 Version 1.2.2 changelog
285 ## 1.2.2
286
287 * 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
288
5803f311 »
2010-05-24 Version bump to 1.2.1
289 ## 1.2.1
290
291 * Changed license from GPL to MIT
292
293 * Fixed gemspec file. Thanks to Razic
294
a251cb36 »
2011-05-28 Indent files correctly and remove trailing whitespace
295 ## 1.2.0
31b3ffb0 »
2010-05-14 Added version 1.2.0 changelog
296
297 * RSpec 2 compatibility. Thanks to Sam Phillips!
298
299 * :allow_localhost => true' now permits 127.0.0.1 as well as 'localhost'. Thanks to Mack Earnhardt
300
301 * Request URI matching in now 2x faster!
302
303
4a040170 »
2010-04-28 Added 1.1.0 changelog
304 ## 1.1.0
305
ee7b3b4b »
2010-04-29 Fixed spelling
306 * [VCR](http://github.com/myronmarston/vcr/) compatibility. Many thanks to Myron Marston for all suggestions.
4a040170 »
2010-04-28 Added 1.1.0 changelog
307
a251cb36 »
2011-05-28 Indent files correctly and remove trailing whitespace
308 * Support for stubbing requests and returning responses with multiple headers with the same name. i.e multiple Accept headers.
309
310 stub_http_request(:get, 'www.example.com').
311 with(:headers => {'Accept' => ['image/png', 'image/jpeg']}).
312 to_return(:body => 'abc')
313 RestClient.get('www.example.com',
314 {"Accept" => ['image/png', 'image/jpeg']}) # ===> "abc\n"
4a040170 »
2010-04-28 Added 1.1.0 changelog
315
316 * When real net connections are disabled and unstubbed request is made, WebMock throws WebMock::NetConnectNotAllowedError instead of assertion error or StandardError.
317
318 * Added WebMock.version()
319
320
66519c1c »
2010-03-26 Updated changelog with 1.0.0 changes
321 ## 1.0.0
322
323 * Added support for [Patron](http://toland.github.com/patron/)
324
325 * Responses dynamically evaluated from block (idea and implementation by Tom Ward)
326
a251cb36 »
2011-05-28 Indent files correctly and remove trailing whitespace
327 stub_request(:any, 'www.example.net').
328 to_return { |request| {:body => request.body} }
66519c1c »
2010-03-26 Updated changelog with 1.0.0 changes
329
a251cb36 »
2011-05-28 Indent files correctly and remove trailing whitespace
330 RestClient.post('www.example.net', 'abc') # ===> "abc\n"
66519c1c »
2010-03-26 Updated changelog with 1.0.0 changes
331
332 * Responses dynamically evaluated from lambda (idea and implementation by Tom Ward)
333
a251cb36 »
2011-05-28 Indent files correctly and remove trailing whitespace
334 stub_request(:any, 'www.example.net').
335 to_return(lambda { |request| {:body => request.body} })
66519c1c »
2010-03-26 Updated changelog with 1.0.0 changes
336
a251cb36 »
2011-05-28 Indent files correctly and remove trailing whitespace
337 RestClient.post('www.example.net', 'abc') # ===> "abc\n"
66519c1c »
2010-03-26 Updated changelog with 1.0.0 changes
338
a251cb36 »
2011-05-28 Indent files correctly and remove trailing whitespace
339 * Response with custom status message
66519c1c »
2010-03-26 Updated changelog with 1.0.0 changes
340
a251cb36 »
2011-05-28 Indent files correctly and remove trailing whitespace
341 stub_request(:any, "www.example.com").to_return(:status => [500, "Internal Server Error"])
66519c1c »
2010-03-26 Updated changelog with 1.0.0 changes
342
a251cb36 »
2011-05-28 Indent files correctly and remove trailing whitespace
343 req = Net::HTTP::Get.new("/")
344 Net::HTTP.start("www.example.com") { |http| http.request(req) }.message # ===> "Internal Server Error"
66519c1c »
2010-03-26 Updated changelog with 1.0.0 changes
345
c3c92bae »
2010-04-10 Added information about allowing localhost to version 1.0.0 changelog
346 * Raising timeout errors (suggested by Jeffrey Jones) (compatibility with Ruby 1.8.6 by Mack Earnhardt)
66519c1c »
2010-03-26 Updated changelog with 1.0.0 changes
347
a251cb36 »
2011-05-28 Indent files correctly and remove trailing whitespace
348 stub_request(:any, 'www.example.net').to_timeout
66519c1c »
2010-03-26 Updated changelog with 1.0.0 changes
349
a251cb36 »
2011-05-28 Indent files correctly and remove trailing whitespace
350 RestClient.post('www.example.net', 'abc') # ===> RestClient::RequestTimeout
66519c1c »
2010-03-26 Updated changelog with 1.0.0 changes
351
c3c92bae »
2010-04-10 Added information about allowing localhost to version 1.0.0 changelog
352 * External requests can be disabled while allowing localhost (idea and implementation by Mack Earnhardt)
353
a251cb36 »
2011-05-28 Indent files correctly and remove trailing whitespace
354 WebMock.disable_net_connect!(:allow_localhost => true)
c3c92bae »
2010-04-10 Added information about allowing localhost to version 1.0.0 changelog
355
a251cb36 »
2011-05-28 Indent files correctly and remove trailing whitespace
356 Net::HTTP.get('www.something.com', '/') # ===> Failure
c3c92bae »
2010-04-10 Added information about allowing localhost to version 1.0.0 changelog
357
a251cb36 »
2011-05-28 Indent files correctly and remove trailing whitespace
358 Net::HTTP.get('localhost:9887', '/') # ===> Allowed. Perhaps to Selenium?
c3c92bae »
2010-04-10 Added information about allowing localhost to version 1.0.0 changelog
359
360
66519c1c »
2010-03-26 Updated changelog with 1.0.0 changes
361 ### Bug fixes
362
363 * Fixed issue where Net::HTTP adapter didn't work for requests with body responding to read (reported by Tekin Suleyman)
c3c92bae »
2010-04-10 Added information about allowing localhost to version 1.0.0 changelog
364 * Fixed issue where request stub with headers declared as nil was matching requests with non empty headers
66519c1c »
2010-03-26 Updated changelog with 1.0.0 changes
365
b6c3b3b9 »
2010-02-02 Version bump to 0.9.1
366 ## 0.9.1
367
368 * Fixed issue where response status code was not read from raw (curl -is) responses
369
5313e02f »
2010-01-31 Added version 0.9.0 features to CHANGELOG and README
370 ## 0.9.0
a251cb36 »
2011-05-28 Indent files correctly and remove trailing whitespace
371
5313e02f »
2010-01-31 Added version 0.9.0 features to CHANGELOG and README
372 * Matching requests against provided block (by Sergio Gil)
373
a251cb36 »
2011-05-28 Indent files correctly and remove trailing whitespace
374 stub_request(:post, "www.example.com").with { |request| request.body == "abc" }.to_return(:body => "def")
375 RestClient.post('www.example.com', 'abc') # ===> "def\n"
376 request(:post, "www.example.com").with { |req| req.body == "abc" }.should have_been_made
377 #or
378 assert_requested(:post, "www.example.com") { |req| req.body == "abc" }
5313e02f »
2010-01-31 Added version 0.9.0 features to CHANGELOG and README
379
66519c1c »
2010-03-26 Updated changelog with 1.0.0 changes
380 * Matching request body against regular expressions (suggested by Ben Pickles)
5313e02f »
2010-01-31 Added version 0.9.0 features to CHANGELOG and README
381
a251cb36 »
2011-05-28 Indent files correctly and remove trailing whitespace
382 stub_request(:post, "www.example.com").with(:body => /^.*world$/).to_return(:body => "abc")
383 RestClient.post('www.example.com', 'hello world') # ===> "abc\n"
384
66519c1c »
2010-03-26 Updated changelog with 1.0.0 changes
385 * Matching request headers against regular expressions (suggested by Ben Pickles)
5313e02f »
2010-01-31 Added version 0.9.0 features to CHANGELOG and README
386
a251cb36 »
2011-05-28 Indent files correctly and remove trailing whitespace
387 stub_request(:post, "www.example.com").with(:headers => {"Content-Type" => /image\/.+/}).to_return(:body => "abc")
388 RestClient.post('www.example.com', '', {'Content-Type' => 'image/png'}) # ===> "abc\n"
5313e02f »
2010-01-31 Added version 0.9.0 features to CHANGELOG and README
389
390 * Replaying raw responses recorded with `curl -is`
391
a251cb36 »
2011-05-28 Indent files correctly and remove trailing whitespace
392 `curl -is www.example.com > /tmp/example_curl_-is_output.txt`
393 raw_response_file = File.new("/tmp/example_curl_-is_output.txt")
5313e02f »
2010-01-31 Added version 0.9.0 features to CHANGELOG and README
394
a251cb36 »
2011-05-28 Indent files correctly and remove trailing whitespace
395 from file
396
397 stub_request(:get, "www.example.com").to_return(raw_response_file)
398
399 or string
400
401 stub_request(:get, "www.example.com").to_return(raw_response_file.read)
5313e02f »
2010-01-31 Added version 0.9.0 features to CHANGELOG and README
402
403 * Multiple responses for repeated requests
404
a251cb36 »
2011-05-28 Indent files correctly and remove trailing whitespace
405 stub_request(:get, "www.example.com").to_return({:body => "abc"}, {:body => "def"})
406 Net::HTTP.get('www.example.com', '/') # ===> "abc\n"
407 Net::HTTP.get('www.example.com', '/') # ===> "def\n"
5313e02f »
2010-01-31 Added version 0.9.0 features to CHANGELOG and README
408
409 * Multiple responses using chained `to_return()` or `to_raise()` declarations
410
a251cb36 »
2011-05-28 Indent files correctly and remove trailing whitespace
411 stub_request(:get, "www.example.com").
412 to_return({:body => "abc"}).then. #then() just is a syntactic sugar
413 to_return({:body => "def"}).then.
414 to_raise(MyException)
415 Net::HTTP.get('www.example.com', '/') # ===> "abc\n"
416 Net::HTTP.get('www.example.com', '/') # ===> "def\n"
417 Net::HTTP.get('www.example.com', '/') # ===> MyException raised
418
5313e02f »
2010-01-31 Added version 0.9.0 features to CHANGELOG and README
419 * Specifying number of times given response should be returned
420
a251cb36 »
2011-05-28 Indent files correctly and remove trailing whitespace
421 stub_request(:get, "www.example.com").
422 to_return({:body => "abc"}).times(2).then.
423 to_return({:body => "def"})
424
425 Net::HTTP.get('www.example.com', '/') # ===> "abc\n"
426 Net::HTTP.get('www.example.com', '/') # ===> "abc\n"
427 Net::HTTP.get('www.example.com', '/') # ===> "def\n"
428
5313e02f »
2010-01-31 Added version 0.9.0 features to CHANGELOG and README
429 * Added support for `Net::HTTP::Post#body_stream`
430
a251cb36 »
2011-05-28 Indent files correctly and remove trailing whitespace
431 This fixes compatibility with new versions of RestClient
432
5313e02f »
2010-01-31 Added version 0.9.0 features to CHANGELOG and README
433 * WebMock doesn't suppress default request headers added by http clients anymore.
434
a251cb36 »
2011-05-28 Indent files correctly and remove trailing whitespace
435 i.e. Net::HTTP adds `'Accept'=>'*/*'` to all requests by default
436
437
438
5313e02f »
2010-01-31 Added version 0.9.0 features to CHANGELOG and README
439 ## 0.8.2
a251cb36 »
2011-05-28 Indent files correctly and remove trailing whitespace
440
5313e02f »
2010-01-31 Added version 0.9.0 features to CHANGELOG and README
441 * Fixed issue where WebMock was not closing IO object passed as response body after reading it.
442 * 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
443
444
445 ## 0.8.1
a251cb36 »
2011-05-28 Indent files correctly and remove trailing whitespace
446
5313e02f »
2010-01-31 Added version 0.9.0 features to CHANGELOG and README
447 * Fixed HTTPClient adapter compatibility with Ruby 1.8.6 (reported by Piotr Usewicz)
448 * Net:HTTP adapter now handles request body assigned as Net::HTTP::Post#body attribute (fixed by Mack Earnhardt)
449 * Fixed issue where requests were not matching stubs with Accept header set.(reported by Piotr Usewicz)
450 * Fixed compatibility with Ruby 1.9.1, 1.9.2 and JRuby 1.3.1 (reported by Diego E. “Flameeyes” Pettenò)
451 * Fixed issue with response body declared as IO object and multiple requests (reported by Niels Meersschaert)
452 * Fixed "undefined method `assertion_failure'" error (reported by Nick Plante)
453
454
455 ## 0.8.0
456
457 * Support for HTTPClient (sync and async requests)
a251cb36 »
2011-05-28 Indent files correctly and remove trailing whitespace
458 * Support for dynamic responses. Response body and headers can be now declared as lambda.
459 (Thanks to Ivan Vega ( @ivanyv ) for suggesting this feature)
5313e02f »
2010-01-31 Added version 0.9.0 features to CHANGELOG and README
460 * Support for stubbing and expecting requests with empty body
461 * Executing non-stubbed request leads to failed expectation instead of error
462
463
464 ### Bug fixes
465
466 * Basic authentication now works correctly
467 * Fixed problem where WebMock didn't call a block with the response when block was provided
468 * Fixed problem where uris with single slash were not matching uris without path provided
469
470
471 ## 0.7.3
472
473 * Clarified documentation
474 * Fixed some issues with loading of Webmock classes
475 * Test::Unit and RSpec adapters have to be required separately
476
477
478 ## 0.7.2
479
480 * Added support for matching escaped and non escaped URLs
Something went wrong with that request. Please try again.