From f742d324ff34d079fdbd7807b0a7f86a2485e1be Mon Sep 17 00:00:00 2001 From: Jun Aruga Date: Jul 25 2016 15:04:02 +0000 Subject: Update to rest-client 2.0.0. --- diff --git a/rubygem-rest-client-2.0.0-use-webmock-1.x.patch b/rubygem-rest-client-2.0.0-use-webmock-1.x.patch new file mode 100644 index 0000000..456c32f --- /dev/null +++ b/rubygem-rest-client-2.0.0-use-webmock-1.x.patch @@ -0,0 +1,15 @@ +diff --git spec/unit/response_spec.rb spec/unit/response_spec.rb +index 096c2ab..e80ef90 100644 +--- spec/unit/response_spec.rb ++++ spec/unit/response_spec.rb +@@ -110,8 +110,8 @@ describe RestClient::Response, :include_helpers do + end + + it "follows a redirection and keep the parameters" do +- 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') ++ 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') + expect(RestClient::Request.execute(:url => 'http://some/resource', :method => :get, :user => 'foo', :password => 'bar', :headers => {:accept => :json}).body).to eq 'Foo' + end + diff --git a/rubygem-rest-client.spec b/rubygem-rest-client.spec index 430a345..87057a9 100644 --- a/rubygem-rest-client.spec +++ b/rubygem-rest-client.spec @@ -2,13 +2,16 @@ %global gem_name rest-client Name: rubygem-%{gem_name} -Version: 1.8.0 -Release: 2%{?dist} +Version: 2.0.0 +Release: 1%{?dist} Summary: Simple HTTP and REST client for Ruby Group: Development/Languages License: MIT URL: https://github.com/rest-client/rest-client Source0: https://rubygems.org/gems/%{gem_name}-%{version}.gem +# To use webmock 1.x on rest-client 2.0.0. +# Remove this patch when using webmock 2.x which is used on the upstream. +Patch0: rubygem-rest-client-2.0.0-use-webmock-1.x.patch BuildRequires: ruby(release) BuildRequires: rubygems-devel BuildRequires: ruby @@ -49,17 +52,12 @@ mkdir -p %{buildroot}%{_bindir} cp -a .%{_bindir}/* \ %{buildroot}%{_bindir}/ -find %{buildroot}%{gem_instdir}/bin -type f | xargs chmod a+x - %check pushd .%{gem_instdir} -# Fix RSpec 3.x compatibility. -# https://github.com/rest-client/rest-client/pull/415 -sed -i -r 's/^(\s*)(.*)(\.should) be_false/\1expect(\2).to be_falsey/' spec/unit/request_spec.rb -sed -i -r 's/^(\s*)(.*)(\.should) be_true/\1expect(\2).to be_truthy/' spec/unit/request{,2}_spec.rb +patch -p0 < %{PATCH0} # Some tests fail without network connection." -rspec spec | grep "225 examples, 8 failures" +rspec spec | grep "298 examples, 14 failures" popd %files @@ -76,7 +74,7 @@ popd %doc %{gem_docdir} %doc %{gem_instdir}/AUTHORS %{gem_instdir}/Gemfile -%doc %{gem_instdir}/README.rdoc +%doc %{gem_instdir}/README.md %{gem_instdir}/Rakefile %doc %{gem_instdir}/history.md %{gem_instdir}/rest-client.gemspec @@ -84,6 +82,9 @@ popd %{gem_instdir}/spec %changelog +* Thu Jul 14 2016 Jun Aruga - 2.0.0-1 +- Update to rest-client 2.0.0. + * Thu Feb 04 2016 Fedora Release Engineering - 1.8.0-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild