Sha256: 26acc231ff0f85e18033a8b815a41ed280d20876cf98d694244e4a779f174b27

Contents?: true

Size: 692 Bytes

Versions: 105

Compression:

Stored size: 692 Bytes

Contents

shared_context "precedence of stubs" do |*adapter_info|
  describe "when choosing a matching request stub" do
    it "should use the last declared matching request stub" do
      stub_request(:get, "www.example.com").to_return(body: "abc")
      stub_request(:get, "www.example.com").to_return(body: "def")
      expect(http_request(:get, "http://www.example.com/").body).to eq("def")
    end

    it "should not be affected by the type of uri or request method" do
      stub_request(:get, "www.example.com").to_return(body: "abc")
      stub_request(:any, /.*example.*/).to_return(body: "def")
      expect(http_request(:get, "http://www.example.com/").body).to eq("def")
    end
  end
end

Version data entries

105 entries across 99 versions & 8 rubygems

Version Path
webmock-3.11.0 spec/acceptance/shared/precedence_of_stubs.rb
webmock-3.10.0 spec/acceptance/shared/precedence_of_stubs.rb
webmock-3.9.5 spec/acceptance/shared/precedence_of_stubs.rb
webmock-3.9.4 spec/acceptance/shared/precedence_of_stubs.rb
webmock-3.9.3 spec/acceptance/shared/precedence_of_stubs.rb
webmock-3.9.2 spec/acceptance/shared/precedence_of_stubs.rb
vagrant-unbundled-2.2.10.0 vendor/bundle/ruby/2.7.0/gems/webmock-2.3.2/spec/acceptance/shared/precedence_of_stubs.rb
webmock-3.9.1 spec/acceptance/shared/precedence_of_stubs.rb
webmock-3.9.0 spec/acceptance/shared/precedence_of_stubs.rb
vagrant-unbundled-2.2.9.0 vendor/bundle/ruby/2.7.0/gems/webmock-2.3.2/spec/acceptance/shared/precedence_of_stubs.rb
vagrant-unbundled-2.2.8.0 vendor/bundle/ruby/2.7.0/gems/webmock-2.3.2/spec/acceptance/shared/precedence_of_stubs.rb
webmock-3.8.3 spec/acceptance/shared/precedence_of_stubs.rb
webmock-3.8.2 spec/acceptance/shared/precedence_of_stubs.rb
webmock-3.8.1 spec/acceptance/shared/precedence_of_stubs.rb
vagrant-unbundled-2.2.7.0 vendor/bundle/ruby/2.6.0/gems/webmock-2.3.2/spec/acceptance/shared/precedence_of_stubs.rb
vagrant-unbundled-2.2.7.0 vendor/bundle/ruby/2.7.0/gems/webmock-2.3.2/spec/acceptance/shared/precedence_of_stubs.rb
webmock-3.8.0 spec/acceptance/shared/precedence_of_stubs.rb
honeybadger-4.5.3 vendor/bundle/ruby/2.6.0/gems/webmock-3.6.0/spec/acceptance/shared/precedence_of_stubs.rb
vagrant-unbundled-2.2.6.2 vendor/bundle/ruby/2.6.0/gems/webmock-2.3.2/spec/acceptance/shared/precedence_of_stubs.rb
vagrant-unbundled-2.2.6.1 vendor/bundle/ruby/2.6.0/gems/webmock-2.3.2/spec/acceptance/shared/precedence_of_stubs.rb