Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(deps): update dependency webmock to v3 #11

Merged
merged 1 commit into from
Nov 27, 2023
Merged

Conversation

renovate[bot]
Copy link
Contributor

@renovate renovate bot commented Nov 27, 2023

Mend Renovate logo banner

This PR contains the following updates:

Package Change Age Adoption Passing Confidence
webmock (changelog) '~> 1.21' -> '~> 3.0' age adoption passing confidence

Release Notes

bblimke/webmock (webmock)

v3.19.1

Compare Source

  • When passing a Proc or lambda as response body to to_return_json, the body is evaluated at the time of request and not at the time of to_return_json method invocation.

    Thanks to [Jason Karns](https://togithub.com/jasonkarns) for reporting.
    

v3.19.0

Compare Source

  • Do not alter real (non-stubbed) request headers when handling em-http-request requests.

    Thanks to [Yoann Lecuyer](https://togithub.com/ylecuyer)
    
    • Fix matching stubs with HashExcludingMatcher

      Thanks to Lucas Arnaud

    • Remove development and test files from the gem package

      Thanks to Orien Madgwick

    • Fix supported http client gem version checks.

      Thanks to Marc Rohloff and Roman Stražanec

    • Non-string body passed to #to_return_json is now converted to JSON string.

      Thanks to inkstak

    • [::1] is recognised as localhost e.g when passing allow_localhost option to disable_net_connect!

      Thanks to Yuki Inoue

    • Optimized normalize_headers for performance

      Thanks to Brandon Weaver

    • Added Frozen string literal to files to optimise memory usage

      Thanks to Josh Nichols

v3.18.1

Compare Source

v3.18.0

Compare Source

  • Net::BufferedIO is not replaced anymore.

    Thanks to Ray Zane

    • Simplified connection handing in Net::HTTP adapter.

      Thanks to Ray Zane

v3.17.1

Compare Source

v3.17.0

Compare Source

  • Minimum required Ruby version is 2.3

    Thanks to Go Sueyoshi

    • When using Net::HTTP, stubbed socket StubSocket#close and StubSocket#closed? behave more like the real sockets.

      Thanks to Ray Zane

    • Added peeraddr, ssl_version and cipher methods to stubbed sockets used by Net::HTTP.

      Thanks to Ray Zane

    • Added support for matching top-level array in JSON request body.

      E.g.

      stub_request(:post, 'www.example.com').with(body: [{a: 1}])
      

      Thanks to Cedric Sohrauer

v3.16.2

Compare Source

  • Minimum required Ruby version is 2.0.

v3.16.1

Compare Source

v3.15.2

Compare Source

  • Minimum required Ruby version is 2.0.

v3.15.1

Compare Source

v3.14.0

Compare Source

v3.13.0

Compare Source

v3.12.2

Compare Source

  • Fixed em-http-request adapter to avoid calling middleware twice.

    Thanks to Alex Vondrak

v3.12.1

Compare Source

  • Fixed handling of URIs with IPv6 addresses with square brackets when in Net::HTTP adapter.

    Thanks to Johanna Hartmann

v3.12.0

Compare Source

  • Added support for handling custom JSON and XML content types e.g. 'application/vnd.api+json'

v3.11.3

Compare Source

v3.11.2

Compare Source

v3.11.1

Compare Source

  • Compatibility with async-http 0.54+

    Thanks to Jun Jiang

v3.11.0

Compare Source

  • Added support for features in http.rb adapter.

    Thanks to Carl (ce07c3)

v3.10.0

Compare Source

  • Added option to global stubs to have lower priority than local stubs.

      WebMock.globally_stub_request(:after_local_stubs) do
        { body: "global stub body" }
      end
    
      stub_request(:get, "www.example.com").to_return(body: 'non-global stub body')
    
      expect(http_request(:get, "http://www.example.com/").body).to eq("non-global stub body")
    

    Thanks to Marek Kasztelnik

v3.9.5

Compare Source

  • Prevent overwriting teardown method in Test::Unit

    Thanks to Jesse Bowes

v3.9.4

Compare Source

  • More intuitive error message when stubbed response body was provided as Hash

    Thanks to Ben Koshy

v3.9.3

Compare Source

  • Make httpclient_adapter thread-safe

    Thanks to Adam Harwood

v3.9.2

Compare Source

v3.9.1

Compare Source

  • Fixed support for passing URI objects as second argument of stub_request

    Thanks to Ryan Kerr

3.9.0

  • Allow using a "callable" (like a proc) as URI pattern

    stub_request(:any, ->(uri) { true })
    

    Thanks to John Hawthorn

  • Added stubbed IO on stubbed socket in Net::HTTP adapter.

    Thanks to Thilo Rusche

  • When 'webmock/rspec' is required, reset WebMock after all after(:each/example) hooks

    Thanks to Andrew Stuntz

  • Fixed net_connect_allowed? when invoked with no arguments, when there were any allowed URIs passed to disable_net_connect?.

    Thanks to Lucas Uyezu

  • Fixed async-http adapter which caused Async::HTTP::Client or Async::HTTP::Internet to hang and never return a response.

    Thanks to Bruno Sutic and Samuel Williams

  • Fixed warning when using async-http adapter

    Thanks to Bruno Sutic

  • Dropped support for Ruby 2.3 - EOL date: 2019-03-31

  • Dropped support for Ruby 2.4 - EOL date: 2020-03-31

  • Handling matching of Addressable::Template patterns that have an ip address without port and patterns that have ip address and don’t have schema and path.

    Thanks to Rafael França and guppy0356

3.8.3

  • Fixed problem introduced in version 3.4.2, which caused matching against Addressable::Template representing host part of the URI to raise an error.

    Thanks to Vesa Laakso

3.8.2

  • Support correct encoding parameter for HTTP.rb 2.x and earlier

    Thanks to Alex Coomans

3.8.1

  • Added support for mocking non-ASCII bodies when making requests with HTTP.rb

    Thanks to Patrik Ragnarsson

3.8.0

3.7.6

  • Suppressed keyword argument warnings in Ruby 2.7 in async-http adapter.

    Thanks to Koichi ITO

3.7.5

  • Suppress Excon warning generated by extra key

    Thanks to Marco Costa

3.7.4

  • Resetting memoized response fields in Curb adapter.

    Thanks to Andrei Sidorov

3.7.3

  • Fix for http.rb. Allow passing an output buffer to HTTP::Response::Body#readpartial

    Thanks to George Claghorn

  • Fixed Manticore adapter to invoke Manticore failure handler on stubbed timeout

    Thanks to Alex Junger

  • Added project metadata to the gemspec

    Thanks to Orien Madgwick

3.7.2

  • Fixed handling of non UTF-8 encoded urls

    Thanks to Rafael França

  • Fixed "shadowing outer local variable" warning

    Thanks to y-yagi

3.7.1

  • Fixed Async::HTTP::Client adapter code to not cause Ruby warning

    Thanks to y-yagi

3.7.0

3.6.2

3.6.1

  • Fixed issue with matching Addressable::Template without a period in the domain

    Thanks to Eike Send

  • Support for write_timeout in Net::HTTP

    Thanks to Claudio Poli

  • Fixed issue with handling urls with ":80" or ":443" in the path.

    Thanks to Csaba Apagyi for reporting and to Frederick Cheung for fixing the issue.

3.6.0

  • Compatibility with the latest version of hashdiff gem, with constant changed from HashDiff to Hashdiff

    Thanks to Jeff Felchner

  • Added a hint to the error message raised when with method is called without args or a block.

    Thanks to Adam Sokolnicki

  • Resetting configured HTTP method in Curb adapter after each request

    Thanks to tiendo1011

  • Added WebMock.enable_net_connect! as an alias for WebMock.allow_net_connect!
    and WebMock.disallow_net_connect! as an alias for WebMock.disable_net_connect!

    Thanks to SoonKhen OwYong

  • Fixed handling of empty arrays as query params when using Faraday

    Thanks to Ryan Moret

3.5.1

  • Disabling TracePoint defined in Net::BufferedIO in case of exception being raised.

    Thanks to Koichi Sasada

3.5.0

  • Ruby 2.6.0 support

    Thanks to Arkadiy Tetelman

  • Added WebMock.reset_executed_requests! method.

    stub_get = stub_request(:get, "www.example.com")
    Net::HTTP.get('www.example.com', '/')
    WebMock::RequestRegistry.instance.times_executed(stub_get.request_pattern)  # => 1
    reset_executed_requests!
    WebMock::RequestRegistry.instance.times_executed(stub_get.request_pattern)  # => 0
    

    Thanks to Olia Kremmyda

  • Performance improvements

    Thanks to Pavel Rosický

3.4.2

  • Fixed rbuf_fill in Net::HTTP adapter to be thread-safe

    Thanks to Arkadiy Tetelman

  • Fix invalid scheme error with Addressable::Template

    Thanks to Kazato Sugimoto

3.4.1

  • When comparing url encoded body to a body from request stub, which was declared as hash, only String, Numeric and boolean hash values are stringified before the comparison.

    Thanks to Lukas Pokorny

3.4.0

  • Ruby 2.6 support. Prevent Net/ReadTimeout error in Ruby 2.6

    Thanks to Koichi ITO

  • Handling query params, which represent nested hashes with keys starting with non word characters.

    Thanks to rapides for reporting the issue.

  • Patron adapter handles PATCH requests with body.

    Thanks to Mattia for reporting the issue.

  • Allowing requests with url encoded body to be matched by request stubs declared with hash body with non-string values.

     stub_request(:post, "www.example.com").with(body: {"a" => 1, "b" => false})
    
     RestClient.post('www.example.com', 'a=1&b=false', :content_type => 'application/x-www-form-urlencoded') # ===> Success
    

    Thanks to Kenny Ortmann for suggesting this feature.

  • When request headers contain 'Accept'=>'application/json' and no registered stub matches the request, WebMock prints a suggested stub code with to_return body set to '{}'.

    Thanks to redbar0n

  • Improved suggested stub output when the request stub only contains headers declaration.

    Thanks to Olia Kremmyda

  • Fixed Curb adapter to handle reset method.

    Thanks tp dinhhuydh for reporting the issue.
    Thanks to Olia Kremmyda for fixing it.

3.3.0

  • Better formatting of outputted request stub snippets, displayed on failures due to unstubbed requests.

    Thanks to Olia Kremmyda

3.2.1

3.2.0

  • Automatically disable WebMock after Rspec suite

    Thanks to Michał Matyas

  • Fixed bug when handling redirection using Curb.

    Thanks to Olia Kremmyda

3.1.1

  • Warning message is displayed only once when adding query params to URIAddressablePattern.

3.1.0

  • http.rb 3.0.0 compatibility

    Thanks to Piotr Boniecki

  • Typhoeus 1.3.0 support

    Thanks to NARUSE, Yui

  • Added support for matching partial query params using hash_excluding

    stub_request(:get, "www.example.com").
      with(query: hash_excluding({"a" => "b"}))
    
    RestClient.get("http://www.example.com/?a=b")    # ===> Failure
    RestClient.get("http://www.example.com/?a=c")    # ===> Success
    

    Thanks to Olexandr Hoshylyk

  • Added MRI 2.3+ frozen string literal compatibility

    Thanks to Pat Allan

  • Ensured that HTTPClient adapter does not yield block on empty response body if a block is provided

    Thanks to NARUSE, Yui

  • Fixed issue with to_timeout incorrectly raising HTTP::ConnectionError instead of HTTP::TimeoutError when using http.rb

    Thanks to Rick Song

  • Fixed problem with response.connection.close method being undefined when using http.rb

    Thanks to Janko Marohnić

  • Fixed problem with matching Net::HTTP request header values assigned as numbers.

    Thanks to Felipe Constantino de Oliveira for reporting the issue.

  • Fixed problem with Net::HTTP adapter converting empty response body to nil for non 204 responses.

    Thanks to Jeffrey Charles for reporting the issue.

3.0.1

  • Suppressed `warning: `&' interpreted as argument prefix`

    Thanks to Koichi ITO

3.0.0

  • Dropped support for Ruby 1.9.3

  • Using Ruby >= 1.9 hash key syntax in stub suggestions

    Thanks to Tarmo Tänav

  • Add at_least matchers for fakeweb-style expectations

    Thanks to Joe Marty

  • Fix against "can't modify frozen String' error when Ruby option frozen_string_literal is enabled.

    Thanks to Chris Thomson

  • Handling read_timeout option in Net::HTTP in Ruby >= 2.4

    Thanks to Christof Koenig

  • RequestRegistry fix for RuntimeError - can't add a new key into hash during iteration

    Thanks to Chung-Yi Chi

2.3.2

  • Restored support for Ruby 1.9.3 to comply with semantic versioning.

    Thanks to Jordan Harband for reporting the problem.

2.3.1

  • Added support for Ruby 2.4

    Thanks to Koichi ITO

  • Dropped support for Ruby 1.9.3

2.2.0

  • Added refute_requested as an alias for assert_not_requested

    Thanks to Michael Grosser

  • Raising Net::OpenTimeout instead of Timeout::Error if available when a request stub is declared to_timeout

    Thanks to Gabe Martin-Dempesy

2.1.1

  • Added support for handling status messages in Excon responses.

    Thanks to Tero Marttila for reporting the issue.

2.1.0

  • Added support for on_debug callback in Curb.

    Thanks to Pavel Jurašek

  • Added support for PATCH requests using Curb.

    Thanks to Pavel Jurašek

2.0.3

  • Handling headers passed as an Array to Curl::Easy

    Thanks to Chelsea for reporting the issue.

  • Removed Ruby warnings.

    Thanks to Aaron Kromer

2.0.2

  • Using Base64.strict_encode64 instead of Base64.encode64 to handle long user:pass basic auth credentials

    Thanks to Jonathan Schatz

  • Fixed handling of Authorisation header provided as string instead of array when using em-http-request.

    Thanks to Michael Richardson for reporing the issue.

  • Ensured WebMock.net_connect_explicit_allowed? always returns boolean.

    Thanks tp Jose Luis Honorato

2.0.1

  • Added code responsible for loading em-http-request if available, which has been removed by mistake.

    Thanks to Vasiliy

  • WebMock loads "base64" if it's not yet loaded.

    Thanks to Taiki Ono.

2.0.0

  • require 'webmock' does not enable WebMock anymore. gem 'webmock' can now be safely added to a Gemfile and no http client libs will be modified when it's loaded. Call WebMock.enable! to enable WebMock.

    Please note that require 'webmock/rspec', require 'webmock/test_unit', require 'webmock/minitest' and require 'webmock/cucumber' still do enable WebMock.

  • Dropped support for Ruby < 1.9.3

  • Dropped support for em-http-request < 1.0.0

  • WebMock 2.0 does not match basic authentication credentials in the userinfo part of the url, with credentials passed in Authorization: Basic ... header anymore.
    It now treats the Authorization header and credentials in the userinfo part of a url as two completely separate attributes of a request.

The following stub declaration, which used to work in WebMock 1.x, is not going to work anymore

    stub_request(:get, "user:[email protected]")

    Net::HTTP.start('www.example.com') do |http|
      req = Net::HTTP::Get.new('/')
      req.basic_auth 'user', 'pass'
      http.request(req)
    end    # ===> Failure

In order to stub a request with basic authentication credentials provided in the Authorization header, please use the following code:

    stub_request(:get, "www.example.com").with(basic_auth: ['user', 'pass'])

or

    stub_request(:get, "www.example.com").
      with(headers: 'Authorization' => "Basic #{ Base64.strict_encode64('user:pass').chomp}")

In order to stub a request with basic authentication credentials provided in the url, please use the following code:

    stub_request(:get, "user:[email protected]")

    RestClient.get('user:[email protected]')    # ===> Success

1.24.6

  • Fixed issue with RUBY_VERSION comparison using old RubyGems.

    Thanks to Chris Griego.

  • Support for http.rb >= 2.0.0

1.24.4

  • Fixed the issue with parsing query to a hash with nested array i.e. a[][b][]=one&a[][c][]=two

    Thanks to Tim Diggins for reporting the issue.
    Thanks to Cedric Pimenta for finding the solution.

1.24.3

  • Allow Net:HTTP headers keys to be provided as symbols if RUBY_VERSION >= 2.3.0

    Thanks to Alex Kestner

  • Added a clear message on an attempt to match a multipart encoded request body.
    WebMock doesn't support requests with multipart body... yet.

  • WebMock.disable_net_connect :allow option, provided as regexp, matches https URIs correctly.

  • WebMock.disable_net_connect :allow option can be set as a url string with scheme, host and port.

    WebMock.disable_net_connect!(:allow => 'https://www.google.pl')
    

    Thanks to Gabriel Chaney for reporting the issue.

1.24.2

1.24.1

  • HTTPClient adapter supports reading basic authentication credentials directly from Authorization header.

    Thanks to Michiel Karnebeek

1.24.0

  • Enabled support for Curb > 0.8.6

1.23.0

  • WebMock.disable_net_connect accepts :allow option with an object that responds to #call, receiving a URI object and returning a boolean:

    denylist = ['google.com', 'facebook.com', 'apple.com']
    allowed_sites = lambda{|uri|
      denylist.none?{|site| uri.host.include?(site) }
    }
    WebMock.disable_net_connect!(:allow => allowed_sites)
    
    RestClient.get('www.example.org', '/')  # ===> Allowed
    RestClient.get('www.facebook.com', '/') # ===> Failure
    RestClient.get('apple.com', '/')        # ===> Failure
    

    Thanks to Pablo Brasero

  • Support for HTTPClient stream responses with body chunks

    Thanks to Cedric Pimenta

1.22.6

  • Fixes issue around
    WebMock restricting Addressable
    version, based on Ruby 1.8.7 for all versions of Ruby.

    This change inverts that, and forces Ruby 1.8.7 users to specify in thier
    Gemfile an Addressable version < 2.4.0.

    Thanks to PikachuEXE and
    Matthew Rudy Jacobs.

1.22.5

  • Fixes bug where WebMock tries
    to alias a method that is deprecated in Ruby Versions > 1.9.2 ('sysread' for class 'StringIO')

    Thanks to Marcos Acosta for discovering this bug.

1.22.4

1.22.3

  • Return "effective_url" attribute in Typhoeus::Response

    Thanks to Senya

1.22.2

  • Fix: prevents adding an extra =true to urls with parameters without values

    Thanks to David Begin

1.22.1

  • Adds Rack as a development dependency and removes require rack/utils in main lib.

    Thanks to Keenan Brock

1.22.0

All the credit for preparing this release go to David Begin!

  • Adds Manticore support.

    Thanks to Mike Knepper, David Abdemoulaie

  • Update to Show a hash diff for requests that have stubs with a body.

    Thanks to yurivm

  • Update to mirror Net::HTTP handling of headers as symbols

  • Update to ignore non-comparable-values error when sorting
    query values, because sorting is just a convience.

    Thanks to Magne Land

  • Covert Boolean values to Strings when using them to define
    the body of a request.

    Thanks to Krzysztof Rygielski

  • Fixes WebMock's parsing Multibyte characters

    Thanks to Zhao Wen

  • Updates to be compatible with httpclient 2.6.0

  • Converts keys from symbols to strings when for QueryMapper.to_query

    Thanks to Ramon Tayag

  • Restricts http.rb version to 0.7.3 for Ruby 1.8.7

  • Fixes issue emulating em-http-request's handling of multiple requests.

    Thanks to Matt Palmer

  • WebMock requires only the necessary parts of crack to avoid pulling in safe_yaml

    Thanks to Johannes Schlumberger

1.21.0

  • Support for http.rb >= 0.8.0

    Thanks to Zachary Anker, Aleksey V. Zapparov

  • Support for http.rb 0.7.0

    Thanks to Mattias Putman

  • Added support for RSpec3-like and_return, and_raise, and_timeout syntax.

    Thanks to Franky Wahl

  • Restricted Curb support up to version 0.8.6. WebMock specs fail with Curb 0.8.7.

1.20.4

  • Fixed support for hash_including matcher in RSpec 3

1.20.3

  • with method raises error if provided without options hash and without block

  • with and to_return raise an error if invoked with invalid keys in options hash.

1.20.2

  • WebMock provides a helpful error message if an incompatible object is given as response body.

    Thanks to Mark Lorenz

1.20.1

  • assert_requested and assert_not_requested accept at_least_times and at_most_times options

    Thanks to Dan Buettner

  • Silenced instance variable undefined warnings in Curb adapted.

    Thanks to Sven Riedel

1.20.0

1.19.0

  • Fixed issue with Excon adapter giving warning message when redirects middleware was enabled.

    Thanks to Theo Hultberg for reporting that.

  • Fixed issue with undefined method 'valid_request_keys' for Excon::Utils:Module

    Thanks to Pablo Jairala

  • Fixed query mapper to encode 'one' => ['1','2'] as 'one[]=1&one[]=2'.

    Thanks to Insoo Buzz Jung

  • Improved cookies support for em-http-request

    Thanks to Carlos Alonso Pérez

  • Fix HTTP Gem adapter to ensure uri attribute is set on response object.

    Thanks to Aleksey V. Zapparov

  • Fixed HTTPClient adapter. The response header now receives request_method, request_uri, and request_query transferred from request header

    Thanks to trlorenz

  • Query mapper supports nested data structures i.e. {"first" => [{"two" => [{"three" => "four"}, "five"]}]}

    Thanks to Alexander Simonov

  • Fixed compatibility with latest versions of Excon which don't define VALID_REQUEST_KEYS anymore.

    Thanks to Pablo Jairala

  • Request method is always a symbol is request signatures. This fixes the issue of WebMock not matching Typhoeus requests with request method defined as string.

    Thanks to Thorbjørn Hermanse

  • Stubbing instructions which are displayed when no matching stub is found, can be disabled with Config.instance.show_stubbing_instructions = false

    Thanks to Mark Lorenz

  • Notation used for mapping query strings to data structure can be configured i.e. WebMock::Config.instance.query_values_notation = :subscript. This allows setting :flat_array notation which supports duplicated parameter names in query string.

    Thanks to tjsousa

1.18.0

  • Updated dependency on Addressable to versions >= 2.3.6

  • Added support for matching uris using RFC 6570 (URI Templates)

      uri_template = Addressable::Template.new "www.example.com/{id}/"
      stub_request(:any, uri_template)
    

    Thanks to Max Lincoln

  • Fixed content length calculation for Rack responses with UTF8 body

    Thanks to Oleg Gritsenko

  • Add missing Curl::Easy aliases

    Thanks to Hwan-Joon Choi

  • HTTP Gem >= 0.6.0 compatibility

    Thanks to Aleksey V. Zapparov

  • Minitest 4 and 5 compatibility.

    Thanks to SHIBATA Hiroshi

1.17.4

  • Update matchers for RSpec 3's matcher protocol

    Thanks to Rob Olson

1.17.3

1.17.2

  • Support for chunked responses in Curb

    Thanks to Zachary Belzer

  • Fixed handling of request body passed as a hash to Typhoeus.post

    Thanks to Mason Chang for reporting.

1.17.1

1.17.0

  • HTTP gem support!

    Thanks to Aleksey V. Zapparov

  • Limited Excon gem requirement to version < 0.30 until the compatibility with version > 0.30.0 is fixed.

    Thanks to Aleksey V. Zapparov

  • Fixed issue where empty query key caused a TypeError

    Thanks to Jon Rowe

  • Handling Typhoeus on_headers and on_body params.

    Thanks to Matt Burke

1.16.1

1.16.0

  • Allow a Pathname to be passed as a Response body

      stub_request(:get, /example.com/).to_return(
        body: Rails.root.join('test/fixtures/foo.txt')
      )
    

    Thanks to Ben Pickles

  • hash_including matcher can be initialized with empty keys to match any values.

      stub_request(:post, "www.example.com").with(:body => hash_including(:a, :b => {'c'}))
      RestClient.post('www.example.com', '{"a":"1","b":"c"}', :content_type => 'application/json')
    

    Thanks to Stefano Uliari

1.15.2

1.15.0

1.14.0

  • Handling non UTF-8 characters in query params.

    Thanks to Florian Dütsch for reporting the issue.

  • Added support for request_block param in Excon

    Thanks to Dmitry Gutov for reporting the issue.

  • Fixed compatibility with latest Curb

    Thanks to Ian Lesperance and Matthew Horan

  • Triggering errbacks assynchronously in em-http-request adapter.

    Thanks to Ian Lesperance and Matthew Horan

  • Handling query params with a hashes nested inside arrays.

    Thanks to Ian Asaff

  • Changed NetConnectNotAllowedError to inherit from Exception to allow it to bubble up into a test suite.

    Thanks to Daniel van Hoesel

  • HTTPClient adapter is thread safe.

    Thanks to Tom Beauvais

1.13.0

  • Net::HTTP::Persistent compatibility.
    WebMock doesn't disconnect previously started connections upon a request anymore.

1.12.3

  • Fixed issue with handling Addressable::URI with query params passed to Net::HTTP.get_response

    Thanks to Leif Bladt

  • Fixed HTTPClient adapter to not raise an error if a request with multipart body is executed.

1.12.2

  • Fixed issue with handling request.path when Addressable::URI is passed to #request instead of URI with Ruby 2.0.

    Thanks to Leif Bladt

  • Accept integers as query param values in request stubs

    i.e. stub_request(:get, /.*/).with(:query => {"a" => 1})

    Thanks to Mitsutaka Mimura

1.12.1

  • Fixed Minitest < 5.0 compatibility

    Thanks to Alex Tomlins for reporting the issue.

1.12.0

  • Not using Gem spec anymore to check loaded Curb version.

  • WebMock.disable_net_connect! now accepts array of regexps as allow param:

    i.e. WebMock.disable_net_connect!(:allow => [/google.com/, /yahoo.com/])

    Thanks to Bastien Vaucher

  • Fixed on_header Curb callback behaviour in Curb adapter

    Thanks to Joel Chippindale

  • Fixed aws-sdk compatibility with Ruby 2.0, by supporting continue_timeout accessor on Net::HTTP socket.

    Thanks to Lin Jen-Shin

  • Fixed WebMock::Server to not give "log writing failed. can't be called from trap context" warning with Ruby 2.0

    Thanks to Murahashi Sanemat Kenichi

  • Added support for EM-HTTP-Request streaming data off disk feature.

    Thanks to Lin Jen-Shin

  • Added compatibility with Minitest 5

    Thanks to Tim Kurvers

  • Excon >= 0.22 compatibility.

  • README has nice sytnax hightlighting and fixed code styling!

    Thanks to Ilya Vassilevsky

  • Compatibility with Rails 4 rack.session.options

    Thanks to gotwalt

1.11.0

1.10.2

  • '+' in request path is treated as plus, but in query params always as a space.

1.10.1

  • '+' in request body is still treated as a space. This fixes a bug introduced in previous version.

    Thanks to Erik Michaels-Ober for reporting this problem.

  • Fixed issue: response body declared as Proc was not evaluated again on subsequent requests.

    Thanks to Rick Fletcher for reporting this issue.

1.10.0

  • '+' in query params is not treated as space anymore and is encoded as %2B

    Thanks to goblin for reporting this issue.

  • added remove_request_stub method to the api to allow removing unused stubs i.e.

      stub_get = stub_request(:get, "www.example.com")
      remove_request_stub(stub_get)
    
  • assert_requested and assert_not_requested raise an error if a stub object is provided together with a block.

1.9.3

  • Fixed issue with unavailable constant Mutex in Ruby < 1.9

    Thanks to Lucas Dohmen for reporting this issue.

1.9.2

  • Added support for Excon's :response_block parameter

    Thanks to Myron Marston for reporting this issue.

1.9.1

1.9.0

  • Added support for Typhoeus >= 0.5.0 and removed support for Typhoeus < 0.5.0.

    Thanks to Hans Hasselberg

1.8.11

  • Fix excon adapter to handle :body => some_file_object

    Thanks to Myron Marston

1.8.10

  • em-http-request fix. After request callbacks are correctly invoked for 3xx responses,
    when :redirects option is set.

    Thanks to Myron Marston for reporting that issue.

  • Fixed compatibility with Net::HTTP::DigestAuth

    Thanks to Jonathan Hyman for reporting that issue.

  • Fixed problem in em-http-request 0.x appending the query to the client URI twice.

    Thanks to Paweł Pierzchała

1.8.9

1.8.8

  • Fixed Net::HTTP adapter so that it returns nil for an empty body response.

    Thanks to Myron Marston

  • Gemspec defines compatibility with Addressable ~> 2.2.8, not >= 2.3.0

  • Specs compatibility with Typhoeus 0.4.0

    Thanks to Hans Hasselberg

  • Handling content types that specify a charset

    Thanks to Kevin Glowacz

  • Fixed em-http-request adapter to correctly fetch authorization header from a request

    Thanks to Julien Boyer

  • Fixing travis-ci image to report master's status

    Thanks to Ryan Schlesinger

  • Fixed problem with em-http-request callback triggering if there were other EM::Deferred callbacks registered

    Thanks to Jon Leighton

  • Fixed problem with em-http-request appending the query to the URI a second time, and
    the parameters are repeated.

    Thanks to Jon Leighton

1.8.7

  • Compatibility with RSpec >= 2.10

    Thanks to erwanlr for reporting this issue.

  • Add missing required rack environment variable SCRIPT_NAME

    Thanks to Eric Oestrich

  • Fixed warnings due to @​query_params not being initialized

    Thanks to Ben Bleything

1.8.6

  • Pass through SERVER_PORT when stubbing to rack

    Thanks to Eric Oestrich

  • Fixed problem with missing parenthesis in WebMock#net_connect_allowed? conditions.

    Thanks to aindustries

1.8.5

  • WebMock::RackResponse supports basic auth

    Thanks to jugyo

1.8.4

  • Warning message is printed when an unsupported version of a http library is loaded.

    Thanks to Alexander Staubo for reporting the problem and to Myron Marston for a help with solution.

1.8.3

  • Fixed compatibility with latest em-http-request

    Thanks to Paul Cortens

1.8.2

  • Prevent Webmock hash_including from overriding RSpec version 1 hash_including method.

    Thanks to Joe Karayusuf

  • Ensured WebMock handles RSpec 1 hash_including matcher for matching query params and body.

1.8.1

  • Ensured WebMock doesn't interfere with em-synchrony, when em-synchrony/em-http is not included.

    Thanks to Nick Recobra

  • Improved README

    Thanks to Jordan Elver

1.8.0

  • Matching request body against partial hash.

      stub_http_request(:post, "www.example.com").
              with(:body => hash_including({:data => {:a => '1', :b => 'five'}}))
    
      RestClient.post('www.example.com', "data[a]=1&data[b]=five&x=1",
      :content_type => 'application/x-www-form-urlencoded')    # ===> Success
    
      request(:post, "www.example.com").
      with(:body => hash_including({:data => {:a => '1', :b => 'five'}}),
      :headers => 'Content-Type' => 'application/json').should have_been_made         # ===> Success
    

    Thanks to Marnen Laibow-Koser for help with this solution

  • Matching request query params against partial hash.

      stub_http_request(:get, "www.example.com").with(:query => hash_including({"a" => ["b", "c"]}))
    
      RestClient.get("http://www.example.com/?a[]=b&a[]=c&x=1") # ===> Success
    
      request(:get, "www.example.com").
        with(:query => hash_including({"a" => ["b", "c"]})).should have_been_made  # ===> Success
    
  • Added support for Excon.

    Thanks to Dimitrij Denissenko

  • Added support for setting expectations on the request stub with assert_requested

      stub_get = stub_request(:get, "www.example.com")
      stub_post = stub_request(:post, "www.example.com")
    
      Net::HTTP.get('www.example.com', '/')
    
      assert_requested(stub_get)
      assert_not_requested(stub_post)
    

    Thanks to Nicolas Fouché

  • WebMock.disable_net_connect! accepts RegExp as :allow parameter

    Thanks to Frank Schumacher

  • Ensure multiple values for the same header can be recorded and played back

    Thanks to Myron Marston

  • Updated dependency on Addressable to version >= 2.2.7 to handle nested hash query values. I.e. ?one[two][three][]=four&one[two][three][]=five

  • Fixed compatibility with Curb >= 0.7.16 This breaks compatibility with Curb < 0.7.16

  • Fix #to_rack to handle non-array response bodies.

    Thanks to Tammer Saleh

  • Added read_timeout accessor to StubSocket which fixes compatibility with aws-sdk

    Thanks to Lin Jen-Shin

  • Fix warning "instance variable @​query_params not initialized"

    Thanks to Joe Van Dyk

  • Using bytesize of message instead of its length for content-length header in em-http-request adapter.
    This fixes a problem with messages getting truncated in Ruby >= 1.9

    Thanks to Mark Abramov

  • Fixed problem with body params being matched even if params were different.

    Thanks to Evgeniy Dolzhenko for reporting this issue.

1.7.10

  • Yanked 1.7.9 and rebuilt gem on 1.8.7 to deal with syck/psych incompatibilties in gemspec.

1.7.9

1.7.8

  • Fix each adapter so that it calls a stub.with block only once per
    request. Previously, the block would be called two or three times per
    request Myron Marston.

1.7.7 - RuPy 2011 release

  • Passing response object to a block passed to HTTPClient#do_get_block. This fixes HTTPClient.get_content failures. issue 130

    Thanks to Chris McGrath

  • Cleaned up ruby warnings when running WebMock code with -w.

    Thanks to Stephen Celis

  • Curb adapter now correctly calls on_failure for 4xx response codes.

    Thanks to Eugene Pimenov

1.7.6

  • Support for the HTTPClient's request_filter feature

    Thanks to Roman Shterenzon

1.7.5

  • 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

1.7.4

  • Added support for matching EM-HTTP-Request requests with body declared as a Hash

    Thanks to David Yeu

1.7.3

  • 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.

    Thanks to Klaus Hartl for reporting this issue.

1.7.2

  • Redefined const_get and constants methods on the replaced Net::HTTP to return same values as original Net::HTTP

1.7.1

  • 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.

    Thanks to Cássio Marques for reporting the issue and to Myron Marston for help with the solution.

1.7.0

  • 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 and Curb::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.

1.6.4

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.

1.6.3

  • 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
    .

1.6.2

  • 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

1.6.1

  • Fixed issue with webmock/rspec which didn't load correctly if rspec/core was already required but rspec/expectations not.

1.6.0

  • 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 n


Configuration

📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - "before 4am on Monday" (UTC).

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about this update again.


  • If you want to rebase/retry this PR, check this box

This PR has been generated by Mend Renovate. View repository job log here.

@renovate renovate bot force-pushed the renovate/webmock-3.x branch from 0dad94f to 39decbf Compare November 27, 2023 16:05
@damacus damacus merged commit 8f3b368 into main Nov 27, 2023
5 checks passed
@damacus damacus deleted the renovate/webmock-3.x branch November 27, 2023 16:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant