Changelog History
Page 13
-
v1.7.6 Changes
- π Support for the HTTPClient's request_filter feature
Thanks to Roman Shterenzon
-
v1.7.5 Changes
- β 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.
Thanks to Andreas Garnæs
-
v1.7.4 Changes
- β Added support for matching EM-HTTP-Request requests with body declared as a Hash
Thanks to David Yeu
-
v1.7.3 Changes
- β Added
Get
,Post
,Delete
,Put
,Head
,Option
constants to replacedNet::HTTP
to make it possible to marshal objects with these constants assigned to properties. This fixed problem withtvdb_party
gem which serializes HTTParty responses.
Thanks to Klaus Hartl for reporting this issue.
- β Added
-
v1.7.2 Changes
- Redefined
const_get
andconstants
methods on the replacedNet::HTTP
to return same values as originalNet::HTTP
- Redefined
-
v1.7.1 Changes
- π Redefined
const_defined?
on the replacedNet::HTTP
so that it returns true if constant is defined on the originalNet::HTTP
. This fixes problems with"Net::HTTP::Get".constantize
.
Thanks to CΓ‘ssio Marques for reporting the issue and to Myron Marston for help with the solution.
- π Redefined
-
v1.7.0 Changes
Fixed Net::HTTP adapter to not break normal Net::HTTP behaviour when network connections are allowed. This fixes selenium-webdriver compatibility!!!
β Added support for EM-HTTP-Request 1.0.x and EM-Synchrony. Thanks to Steve Hull
β Added support for setting expectations to on a stub itself i.e.
stub = stub_request(:get, "www.example.com") # ... make requests ... stub.should have_been_requested
Thanks to Aidan Feldman
β Minitest support! Thanks to Peter Higgins
β Added support for Typhoeus::Hydra
Added support for
Curb::Easy#http_post
andCurb::Easy#http_post
with multiple arguments. Thanks to Salvador Fuentes Jr and Alex Rothenbergπ Rack support. Requests can be stubbed to respond with a Rack app i.e.
class MyRackApp def self.call(env) [200, {}, ["Hello"]] end end stub_request(:get, "www.example.com").to_rack(MyRackApp) RestClient.get("www.example.com") # ===> "Hello"
Thanks to Jay Adkisson
β Added support for selective disabling and enabling of http lib adapters
WebMock.disable! #disable WebMock (all adapters) WebMock.disable!(:except => [:net_http]) #disable WebMock for all libs except Net::HTTP WebMock.enable! #enable WebMock (all adapters) WebMock.enable!(:except => [:patron]) #enable WebMock for all libs except Patron
The error message on an unstubbed request shows a code snippet with body as a hash when it was in url encoded form.
> RestClient.post('www.example.com', "data[a]=1&data[b]=2", :content_type => 'application/x-www-form-urlencoded') WebMock::NetConnectNotAllowedError: Real HTTP connections are disabled.... You can stub this request with the following snippet: stub_request(:post, "http://www.example.com/"). with(:body => {"data"=>{"a"=>"1", "b"=>"2"}}, :headers => { 'Content-Type'=>'application/x-www-form-urlencoded' }). to_return(:status => 200, :body => "", :headers => {})
Thanks to Alex Rothenberg
The error message on an unstubbed request shows currently registered request stubs.
> stub_request(:get, "www.example.net") > stub_request(:get, "www.example.org") > RestClient.get("www.example.com") WebMock::NetConnectNotAllowedError: Real HTTP connections are disabled.... You can stub this request with the following snippet: stub_request(:get, "http://www.example.com/"). to_return(:status => 200, :body => "", :headers => {}) registered request stubs: stub_request(:get, "http://www.example.net/") stub_request(:get, "http://www.example.org/")
Thanks to Lin Jen-Shin for suggesting this feature.
π Fixed problem with matching requests with json body, when json strings have date format. Thanks to Joakim Ekberg for reporting this issue.
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 for suggesting this change.
External requests can be disabled while allowing selected ports on selected hosts
WebMock.disable_net_connect!(:allow => "www.example.com:8080") RestClient.get("www.example.com:80") # ===> Failure RestClient.get("www.example.com:8080") # ===> Allowed.
Thanks to Zach Dennis
π Fixed syntax error in README examples, showing the ways of setting request expectations. Thanks to Nikita Fedyashev
π· Many thanks to WebMock co-maintainer James Conroy-Finn who did a great job maintaining WebMock on his own for the last couple of months.
-
v1.6.4 Changes
π This is a quick slip release to regenerate the gemspec. Apparently jeweler inserts dependencies twice if you use the
gemspec
method in your Gemfile and declare gem dependencies in your gemspec.https://github.com/technicalpickles/jeweler/issues/154
josevalim:
π > This just bit me. I just released a gem with the wrong dependencies β‘οΈ > because I have updated jeweler. This should have been opt-in, π > otherwise a bunch of people using jeweler are going to release gems
with the wrong dependencies because you are automatically importing from the Gemfile.
-
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