Sha256: 11a303290f01c16bd555565fd5565d5b1aa963067fc1026e340eabe558301ba7

Contents?: true

Size: 704 Bytes

Versions: 91

Compression:

Stored size: 704 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

91 entries across 89 versions & 8 rubygems

Version Path
cloudsmith-api-0.49.98 vendor/bundle/ruby/2.6.0/gems/webmock-1.24.6/spec/acceptance/shared/precedence_of_stubs.rb
cloudsmith-api-0.49.94 vendor/bundle/ruby/2.6.0/gems/webmock-1.24.6/spec/acceptance/shared/precedence_of_stubs.rb
cloudsmith-api-0.49.21 vendor/bundle/ruby/2.6.0/gems/webmock-1.24.6/spec/acceptance/shared/precedence_of_stubs.rb
cloudsmith-api-0.49.15 vendor/bundle/ruby/2.6.0/gems/webmock-1.24.6/spec/acceptance/shared/precedence_of_stubs.rb
cloudsmith-api-0.49.13 vendor/bundle/ruby/2.6.0/gems/webmock-1.24.6/spec/acceptance/shared/precedence_of_stubs.rb
cloudsmith-api-0.49.9 vendor/bundle/ruby/2.3.0/gems/webmock-1.24.6/spec/acceptance/shared/precedence_of_stubs.rb
vagrant-unbundled-2.2.7.0 vendor/bundle/ruby/2.4.0/gems/webmock-1.24.6/spec/acceptance/shared/precedence_of_stubs.rb
cloudsmith-api-0.44.4 vendor/bundle/ruby/2.3.0/gems/webmock-1.24.6/spec/acceptance/shared/precedence_of_stubs.rb
dadapush_client-1.0.1 vendor/bundle/ruby/2.3.0/gems/webmock-1.24.6/spec/acceptance/shared/precedence_of_stubs.rb
cloudsmith-api-0.30.7 vendor/bundle/ruby/2.3.0/gems/webmock-1.24.6/spec/acceptance/shared/precedence_of_stubs.rb
color_me_shop-1.0.0 vendor/bundle/ruby/2.5.0/gems/webmock-1.24.6/spec/acceptance/shared/precedence_of_stubs.rb
vagrant-unbundled-2.0.2.0 vendor/bundle/ruby/2.4.0/gems/webmock-1.24.6/spec/acceptance/shared/precedence_of_stubs.rb
vagrant-unbundled-2.0.1.0 vendor/bundle/ruby/2.4.0/gems/webmock-1.24.6/spec/acceptance/shared/precedence_of_stubs.rb
cloudsmith-api-0.21.4 vendor/bundle/ruby/2.3.0/gems/webmock-1.24.6/spec/acceptance/shared/precedence_of_stubs.rb
vagrant-unbundled-2.0.0.1 vendor/bundle/ruby/2.4.0/gems/webmock-1.24.6/spec/acceptance/shared/precedence_of_stubs.rb
vagrant-unbundled-1.9.8.1 vendor/bundle/ruby/2.4.0/gems/webmock-1.24.6/spec/acceptance/shared/precedence_of_stubs.rb
vagrant-unbundled-1.9.7.1 vendor/bundle/ruby/2.4.0/gems/webmock-1.24.6/spec/acceptance/shared/precedence_of_stubs.rb
vagrant-unbundled-1.9.5.1 vendor/bundle/ruby/2.4.0/gems/webmock-1.24.6/spec/acceptance/shared/precedence_of_stubs.rb
logstash-filter-zabbix-0.1.2 vendor/bundle/jruby/1.9/gems/webmock-1.21.0/spec/acceptance/shared/precedence_of_stubs.rb
logstash-filter-zabbix-0.1.1 vendor/bundle/jruby/1.9/gems/webmock-1.21.0/spec/acceptance/shared/precedence_of_stubs.rb