Changelog History
Page 13
-
v1.6.3 Changes
β‘οΈ Update the dependency on addressable to get around an issue in v2.2.5. Thanks to Peter Higgins.
β Add support for matching parameter values using a regular expression as well as a string. Thanks to Oleg M Prozorov.
π Fix integration with httpclient as the internal API has changed. Thanks to Frank PrΓΆΓdorf.
Ensure Curl::Easy#content_type is always set. Thanks to Peter Higgins.
π Fix bug with em-http-request adapter stubbing responses that have a chunked transfer encoding. Thanks to Myron Marston.
π Fix a load of spec failures with Patron, httpclient, and specs that depended on the behaviour of example.com. Thanks to Alex Grigorovich.
-
v1.6.2 Changes
Em-http-request adapter sets
last_effective_url
property. Thanks to Sam Stokes.Curb adapter supports
Curb::Easy#http_post
andCurb::Easy#http_put
without arguments (by settingpost_body
orput_data
beforehand). Thanks to Eugene Bolshakov
-
v1.6.1 Changes
- π Fixed issue with
webmock/rspec
which didn't load correctly ifrspec/core
was already required butrspec/expectations
not.
- π Fixed issue with
-
v1.6.0 Changes
β Simplified integration with Test::Unit, RSpec and Cucumber. Now only a single file has to be required i.e.
require 'webmock/test_unit' require 'webmock/rspec' require 'webmock/cucumber'
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.
The expectation failure message now contains a list of made requests. Thanks to Martyn Loughran for suggesting this feature.
Added
WebMock.print_executed_requests
method which can be useful to find out what requests were made until a given point.em-http-request adapter is now activated by replacing EventMachine::HttpRequest constant, instead of monkeypatching the original class.
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:
EventMachine::WebMockHttpRequest.activate! EventMachine::WebMockHttpRequest.deactivate! Thanks to Martyn Loughran for suggesting this feature.
π
WebMock.reset_webmock
is deprecated in favour of newWebMock.reset!
π Fixed integration with Cucumber. Previously documented example didn't work with new versions of Cucumber.
π Fixed stubbing requests with body declared as a hash. Thanks to Erik Michaels-Ober for reporting the issue.
π 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.
π Fixed problem with assert_requested which didn't work if used outside rspec or test/unit
β Removed dependency on json gem
-
v1.5.0 Changes
π Support for dynamically evaluated raw responses recorded with
curl -is
i.e.`curl -is www.example.com > /tmp/www.example.com.txt` stub_request(:get, "www.example.com").to_return(lambda { |request| File.new("/tmp/#{request.uri.host.to_s}.txt" }))
:net_http_connect_on_start
option can be passed toWebMock.allow_net_connect!
andWebMock.disable_net_connect!
methods, i.e.WebMock.allow_net_connect!(:net_http_connect_on_start => true)
This forces WebMock Net::HTTP adapter to always connect on
Net::HTTP.start
. Check 'Connecting on Net::HTTP.start' in README for more information.Thanks to Alastair Brunton for reporting the issue and for fix suggestions.
π Fixed an issue where Patron spec tried to remove system temporary directory. Thanks to Hans de Graaff
WebMock specs now use RSpec 2
rake spec NO_CONNECTION=true
can now be used to only run WebMock specs which do not make real network connections
-
v1.4.0 Changes
π Curb support!!! Thanks to the awesome work of Pete Higgins!
π
include WebMock
is now deprecated to avoid method and constant name conflicts. Pleaseinclude WebMock::API
instead.π
WebMock::API#request
is renamed toWebMock::API#a_request
to prevent method name conflicts with i.e. Rails controller specs. WebMock.request is still available.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.Removed
WebMock.response_for_request
andWebMock.assertion_failure
which were only used internally and were not documented.: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.
π Fixed issue with both RSpec 1.x and 2.x being available.
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.
Thanks to Hans de Graaff for reporting this.
- π Changed runtime dependency on Addressable version 2.2.2 which fixes handling of percent-escaped '+'
-
v1.3.5 Changes
- External requests can be disabled while allowing selected hosts. Thanks to Charles Li and Ryan Bigg
This feature was available before only for localhost with
:allow_localhost => true
WebMock.disable_net_connect!(:allow => "www.example.org") Net::HTTP.get('www.something.com', '/') # ===> Failure Net::HTTP.get('www.example.org', '/') # ===> Allowed.
- π Fixed Net::HTTP adapter so that it preserves the original behavior of Net::HTTP.
When making a request with a block that calls #read_body on the request, Net::HTTP causes the body to be set to a Net::ReadAdapter, but WebMock was causing the body to be set to a string.
-
v1.3.4 Changes
- π Fixed Net::HTTP adapter to handle cases where a block with
read_body
call is passed torequest
. This fixes compatibility withopen-uri
. Thanks to Mark Evans for reporting the issue.
- π Fixed Net::HTTP adapter to handle cases where a block with
-
v1.3.3 Changes
- π Fixed handling of multiple values for the same response header for Net::HTTP. Thanks to Myron Marston for reporting the issue.
-
v1.3.2 Changes
- π Fixed compatibility with EM-HTTP-Request >= 0.2.9. Thanks to Myron Marston for reporting the issue.