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