All Versions
144
Latest Version
Avg Release Cycle
21 days
Latest Release
-

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 and Curb::Easy#http_put without arguments (by setting post_body or put_data beforehand). Thanks to Eugene Bolshakov

  • v1.6.1 Changes

    • πŸ›  Fixed issue with webmock/rspec which didn't load correctly if rspec/core was already required but rspec/expectations not.
  • 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 new WebMock.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 to WebMock.allow_net_connect! and WebMock.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. Please include WebMock::API instead.

    • πŸš… WebMock::API#request is renamed to WebMock::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 and WebMock.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 to request. This fixes compatibility with open-uri. Thanks to Mark Evans for reporting the issue.
  • 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.