[DRE-maint] Bug#873576: ruby-rest-client: FTBFS without network access

Steve Langasek steve.langasek at canonical.com
Wed Aug 30 00:16:50 UTC 2017


Package: ruby-rest-client
Followup-For: Bug #873576

Control: user ubuntu-devel at lists.ubuntu.com
Control: usertags -1 origin-ubuntu artful ubuntu-patch
Control: tags -1 patch

It appears there is already a patch applied to disable network tests, and it
just needs extending with the set of newly-added network-dependent tests. 
Please find attached a debdiff to do this.

-- 
Steve Langasek                   Give me a lever long enough and a Free OS
Debian Developer                   to set it on, and I can move the world.
Ubuntu Developer                                    http://www.debian.org/
slangasek at ubuntu.com                                     vorlon at debian.org
-------------- next part --------------
diff -Nru ruby-rest-client-2.0.2/debian/patches/disable-network-tests.patch ruby-rest-client-2.0.2/debian/patches/disable-network-tests.patch
--- ruby-rest-client-2.0.2/debian/patches/disable-network-tests.patch	2017-07-25 23:24:23.000000000 -0700
+++ ruby-rest-client-2.0.2/debian/patches/disable-network-tests.patch	2017-08-29 17:14:19.000000000 -0700
@@ -1,11 +1,15 @@
 From: Matthias Klose <doko at ubuntu.com>
-Last-Update: 2016-03-16
+From: Steve Langasek <steve.langasek at ubuntu.com>
+Last-Update: 2017-08-29
 Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=818459
+Bug-Debian: https://bugs.debian.org/873576
 Forwarded: no
 
---- a/spec/integration/request_spec.rb
-+++ b/spec/integration/request_spec.rb
-@@ -10,96 +10,7 @@ describe RestClient::Request do
+Index: ruby-rest-client-2.0.2/spec/integration/request_spec.rb
+===================================================================
+--- ruby-rest-client-2.0.2.orig/spec/integration/request_spec.rb
++++ ruby-rest-client-2.0.2/spec/integration/request_spec.rb
+@@ -10,96 +10,7 @@
    end
  
    describe "ssl verification" do
@@ -103,3 +107,73 @@
    end
  
    describe "timeouts" do
+@@ -113,15 +24,6 @@
+         raise_error(RestClient::Exceptions::OpenTimeout))
+     end
+ 
+-    it "raises ReadTimeout when it hits a read timeout via :read_timeout" do
+-      request = RestClient::Request.new(
+-        :method => :get,
+-        :url => 'https://www.mozilla.org',
+-        :read_timeout => 1e-10,
+-      )
+-      expect { request.execute }.to(
+-        raise_error(RestClient::Exceptions::ReadTimeout))
+-    end
+   end
+ 
+ end
+Index: ruby-rest-client-2.0.2/spec/integration/httpbin_spec.rb
+===================================================================
+--- ruby-rest-client-2.0.2.orig/spec/integration/httpbin_spec.rb
++++ ruby-rest-client-2.0.2/spec/integration/httpbin_spec.rb
+@@ -40,48 +40,6 @@
+   end
+ 
+   describe '.execute' do
+-    it 'sends a user agent' do
+-      data = execute_httpbin_json('user-agent', method: :get)
+-      expect(data['user-agent']).to match(/rest-client/)
+-    end
+-
+-    it 'receives cookies on 302' do
+-      expect {
+-        execute_httpbin('cookies/set?foo=bar', method: :get, max_redirects: 0)
+-      }.to raise_error(RestClient::Found) { |ex|
+-        expect(ex.http_code).to eq 302
+-        expect(ex.response.cookies['foo']).to eq 'bar'
+-      }
+-    end
+-
+-    it 'passes along cookies through 302' do
+-      data = execute_httpbin_json('cookies/set?foo=bar', method: :get)
+-      expect(data).to have_key('cookies')
+-      expect(data['cookies']['foo']).to eq 'bar'
+-    end
+-
+-    it 'handles quote wrapped cookies' do
+-      expect {
+-        execute_httpbin('cookies/set?foo=' + CGI.escape('"bar:baz"'),
+-                        method: :get, max_redirects: 0)
+-      }.to raise_error(RestClient::Found) { |ex|
+-        expect(ex.http_code).to eq 302
+-        expect(ex.response.cookies['foo']).to eq '"bar:baz"'
+-      }
+-    end
+-
+-    it 'sends basic auth' do
+-      user = 'user'
+-      pass = 'pass'
+-
+-      data = execute_httpbin_json("basic-auth/#{user}/#{pass}", method: :get, user: user, password: pass)
+-      expect(data).to eq({'authenticated' => true, 'user' => user})
+-
+-      expect {
+-        execute_httpbin_json("basic-auth/#{user}/#{pass}", method: :get, user: user, password: 'badpass')
+-      }.to raise_error(RestClient::Unauthorized) { |ex|
+-        expect(ex.http_code).to eq 401
+-      }
+-    end
++    # all removed; accessing the network
+   end
+ end


More information about the Pkg-ruby-extras-maintainers mailing list