Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

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