Sha256: ab2a145366e7785cebaf3fae6a34299ed0776171629e669b070cb1eef6f18886

Contents?: true

Size: 678 Bytes

Versions: 4

Compression:

Stored size: 678 Bytes

Contents

shared_context "precedence of stubs" do
  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")
      http_request(:get, "http://www.example.com/").body.should == "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")
      http_request(:get, "http://www.example.com/").body.should == "def"
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
webmock-1.7.10 spec/acceptance/shared/precedence_of_stubs.rb
webmock-1.7.8 spec/acceptance/shared/precedence_of_stubs.rb
webmock-1.7.7 spec/acceptance/shared/precedence_of_stubs.rb
webmock-1.7.6 spec/acceptance/shared/precedence_of_stubs.rb