Skip to content

HTTPS clone URL

Subversion checkout URL

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