From d9f6677304578c86192bafc7bcc7b3c8d2f0836a Mon Sep 17 00:00:00 2001 From: Jun Aruga Date: Tue, 24 May 2016 17:05:52 +0200 Subject: [PATCH] Update to webmock 2.0 --- rest-client.gemspec | 2 +- spec/unit/response_spec.rb | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/rest-client.gemspec b/rest-client.gemspec index cd2a975..84bf2ba 100644 --- a/rest-client.gemspec +++ b/rest-client.gemspec @@ -16,7 +16,7 @@ Gem::Specification.new do |s| s.homepage = 'https://github.com/rest-client/rest-client' s.summary = 'Simple HTTP and REST client for Ruby, inspired by microframework syntax for specifying actions.' - s.add_development_dependency('webmock', '~> 1.4') + s.add_development_dependency('webmock', '~> 2.0') s.add_development_dependency('rspec', '~> 2.99') s.add_development_dependency('pry', '~> 0') s.add_development_dependency('pry-doc', '~> 0') diff --git a/spec/unit/response_spec.rb b/spec/unit/response_spec.rb index c229769..be88cbd 100644 --- a/spec/unit/response_spec.rb +++ b/spec/unit/response_spec.rb @@ -109,8 +109,8 @@ describe RestClient::Response, :include_helpers do end it "follows a redirection and keep the parameters" do - stub_request(:get, 'http://foo:bar@some/resource').with(:headers => {'Accept' => 'application/json'}).to_return(:body => '', :status => 301, :headers => {'Location' => 'http://new/resource'}) - stub_request(:get, 'http://foo:bar@new/resource').with(:headers => {'Accept' => 'application/json'}).to_return(:body => 'Foo') + stub_request(:get, 'http://some/resource').with(:headers => {'Accept' => 'application/json'}, :basic_auth => ['foo', 'bar']).to_return(:body => '', :status => 301, :headers => {'Location' => 'http://new/resource'}) + stub_request(:get, 'http://new/resource').with(:headers => {'Accept' => 'application/json'}, :basic_auth => ['foo', 'bar']).to_return(:body => 'Foo') RestClient::Request.execute(:url => 'http://some/resource', :method => :get, :user => 'foo', :password => 'bar', :headers => {:accept => :json}).body.should eq 'Foo' end