Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

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