Hello community, here is the log from the commit of package rubygem-excon for openSUSE:Factory checked in at 2016-09-12 13:26:07 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/rubygem-excon (Old) and /work/SRC/openSUSE:Factory/.rubygem-excon.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "rubygem-excon" Changes: -------- --- /work/SRC/openSUSE:Factory/rubygem-excon/rubygem-excon.changes 2016-07-21 07:58:50.000000000 +0200 +++ /work/SRC/openSUSE:Factory/.rubygem-excon.new/rubygem-excon.changes 2016-09-12 13:26:09.000000000 +0200 @@ -1,0 +2,14 @@ +Tue Aug 23 04:32:01 UTC 2016 - co...@suse.com + +- updated to version 0.52.0 + see installed changelog.txt + + 0.52.0 08/22/2016 + ================= + + freeze string literals + move toward interpolation, over concatenation (frozen string related) + start conversion toward rspec + move user/pass authorization header setting to request level + +------------------------------------------------------------------- Old: ---- excon-0.51.0.gem New: ---- excon-0.52.0.gem ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ rubygem-excon.spec ++++++ --- /var/tmp/diff_new_pack.dI1E4D/_old 2016-09-12 13:26:10.000000000 +0200 +++ /var/tmp/diff_new_pack.dI1E4D/_new 2016-09-12 13:26:10.000000000 +0200 @@ -24,7 +24,7 @@ # Name: rubygem-excon -Version: 0.51.0 +Version: 0.52.0 Release: 0 %define mod_name excon %define mod_full_name %{mod_name}-%{version} ++++++ excon-0.51.0.gem -> excon-0.52.0.gem ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Gemfile new/Gemfile --- old/Gemfile 2016-07-08 16:19:40.000000000 +0200 +++ new/Gemfile 2016-08-22 23:48:42.000000000 +0200 @@ -3,7 +3,8 @@ gemspec gem 'jruby-openssl', :platform => :jruby -gem 'unicorn', :platforms => [:mri, :rbx] +gem 'puma', :groups => [:development, :test] +gem 'unicorn', :platforms => [:mri, :rbx], :groups => [:development, :test] gem 'rubysl', '~> 2.0', :platform => :rbx gem 'rack', '~> 1.6' diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Gemfile.lock new/Gemfile.lock --- old/Gemfile.lock 2016-07-08 16:19:40.000000000 +0200 +++ new/Gemfile.lock 2016-08-22 23:48:42.000000000 +0200 @@ -1,7 +1,7 @@ PATH remote: . specs: - excon (0.51.0) + excon (0.52.0) GEM remote: http://rubygems.org/ @@ -14,6 +14,7 @@ chronic (0.6.7) delorean (2.0.0) chronic + diff-lcs (1.2.5) eventmachine (1.0.4) eventmachine (1.0.4-java) ffi2-generators (0.1.1) @@ -27,6 +28,7 @@ minitest (4.7.5) multi_json (1.3.6) open4 (1.3.0) + puma (3.6.0) rack (1.6.0) rack-protection (1.2.0) rack @@ -36,6 +38,19 @@ rake (0.9.2.2) rdoc (3.12) json (~> 1.4) + rspec (3.5.0) + rspec-core (~> 3.5.0) + rspec-expectations (~> 3.5.0) + rspec-mocks (~> 3.5.0) + rspec-core (3.5.0) + rspec-support (~> 3.5.0) + rspec-expectations (3.5.0) + diff-lcs (>= 1.2.0, < 2.0) + rspec-support (~> 3.5.0) + rspec-mocks (3.5.0) + diff-lcs (>= 1.2.0, < 2.0) + rspec-support (~> 3.5.0) + rspec-support (3.5.0) rubysl (2.0.14) rubysl-abbrev (~> 2.0) rubysl-base64 (~> 2.0) @@ -272,9 +287,11 @@ jruby-openssl json (>= 1.8.2) open4 + puma rack (~> 1.6) rake rdoc + rspec (>= 3.5.0) rubysl (~> 2.0) shindo sinatra @@ -282,4 +299,4 @@ unicorn BUNDLED WITH - 1.11.2 + 1.12.5 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Rakefile new/Rakefile --- old/Rakefile 2016-07-08 16:19:40.000000000 +0200 +++ new/Rakefile 2016-08-22 23:48:42.000000000 +0200 @@ -44,9 +44,19 @@ ############################################################################# require 'shindo/rake' +require "rspec/core/rake_task" + +RSpec::Core::RakeTask.new(:spec, :format) do |t, args| + format = args[:format] || 'doc' + t.rspec_opts = ["-c", "-f #{format}", "-r ./spec/spec_helper.rb"] + t.pattern = 'spec/**/*_spec.rb' +end + + Shindo::Rake.new -task :default => :tests +task :default => [ :tests, :test] +task :test => :spec require 'rdoc/task' Rake::RDocTask.new do |rdoc| diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/benchmarks/concat_vs_interpolate.rb new/benchmarks/concat_vs_interpolate.rb --- old/benchmarks/concat_vs_interpolate.rb 2016-07-08 16:19:40.000000000 +0200 +++ new/benchmarks/concat_vs_interpolate.rb 2016-08-22 23:48:42.000000000 +0200 @@ -5,17 +5,18 @@ value = '100' Tach.meter(1_000) do tach('concat') do - key << ': ' << value << "\r\n" + temp = '' + temp << key << ': ' << value << "\r\n" end tach('interpolate') do - "#{key}: value\r\n" + "#{key}: #{value}\r\n" end end # +-------------+----------+ # | tach | total | # +-------------+----------+ -# | concat | 0.000902 | +# | interpolate | 0.000404 | +# +-------------+----------+ +# | concat | 0.000564 | # +-------------+----------+ -# | interpolate | 0.019667 | -# +-------------+----------+ \ No newline at end of file diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/changelog.txt new/changelog.txt --- old/changelog.txt 2016-07-08 16:19:40.000000000 +0200 +++ new/changelog.txt 2016-08-22 23:48:42.000000000 +0200 @@ -1,4 +1,13 @@ +0.52.0 08/22/2016 +================= + +freeze string literals +move toward interpolation, over concatenation (frozen string related) +start conversion toward rspec +move user/pass authorization header setting to request level + 0.51.0 07/08/2016 +================= tweak new errors to be an alias rather than inherit Files old/checksums.yaml.gz and new/checksums.yaml.gz differ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/excon.gemspec new/excon.gemspec --- old/excon.gemspec 2016-07-08 16:19:40.000000000 +0200 +++ new/excon.gemspec 2016-08-22 23:48:42.000000000 +0200 @@ -13,8 +13,8 @@ ## If your rubyforge_project name is different, then edit it and comment out ## the sub! line in the Rakefile s.name = 'excon' - s.version = '0.51.0' - s.date = '2016-07-08' + s.version = '0.52.0' + s.date = '2016-08-22' s.rubyforge_project = 'excon' ## Make sure your summary is short. The description may be as long @@ -54,6 +54,7 @@ ## List your development dependencies here. Development dependencies are ## those that are only needed during development # s.add_development_dependency('DEVDEPNAME', [">= 1.1.0", "< 2.0.0"]) + s.add_development_dependency('rspec', '>= 3.5.0') s.add_development_dependency('activesupport') s.add_development_dependency('delorean') s.add_development_dependency('eventmachine', '>= 1.0.4') @@ -119,8 +120,16 @@ lib/excon/socket.rb lib/excon/ssl_socket.rb lib/excon/standard_instrumentor.rb + lib/excon/test/plugin/server/exec.rb + lib/excon/test/plugin/server/puma.rb + lib/excon/test/plugin/server/unicorn.rb + lib/excon/test/plugin/server/webrick.rb + lib/excon/test/server.rb lib/excon/unix_socket.rb lib/excon/utils.rb + spec/excon_spec.rb + spec/excon_test_server_spec.rb + spec/spec_helper.rb tests/authorization_header_tests.rb tests/bad_tests.rb tests/basic_tests.rb diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/excon/connection.rb new/lib/excon/connection.rb --- old/lib/excon/connection.rb 2016-07-08 16:19:40.000000000 +0200 +++ new/lib/excon/connection.rb 2016-08-22 23:48:42.000000000 +0200 @@ -1,3 +1,4 @@ +# frozen_string_literal: true module Excon class Connection include Utils @@ -69,13 +70,6 @@ @data[:instrumentor] = Excon::StandardInstrumentor end - # Use Basic Auth if url contains a login - if @data[:user] || @data[:password] - user, pass = Utils.unescape_form(@data[:user].to_s), Utils.unescape_form(@data[:password].to_s) - @data[:headers]['Authorization'] ||= 'Basic ' << ['' << user.to_s << ':' << pass.to_s].pack('m').delete(Excon::CR_NL) - end - - @socket_key = '' << @data[:scheme] if @data[:scheme] == UNIX if @data[:host] raise ArgumentError, "The `:host` parameter should not be set for `unix://` connections.\n" + @@ -83,10 +77,10 @@ elsif !@data[:socket] raise ArgumentError, 'You must provide a `:socket` for `unix://` connections' else - @socket_key << '://' << @data[:socket] + @socket_key = "#{@data[:scheme]}://#{@data[:socket]}" end else - @socket_key << '://' << @data[:host] << port_string(@data) + @socket_key = "#{@data[:scheme]}://#{@data[:host]}#{port_string(@data)}" end reset end @@ -105,7 +99,7 @@ else socket.data = datum # start with "METHOD /path" - request = datum[:method].to_s.upcase << ' ' + request = datum[:method].to_s.upcase + ' ' if datum[:proxy] && datum[:scheme] != HTTPS request << datum[:scheme] << '://' << datum[:host] << port_string(datum) end @@ -151,7 +145,7 @@ if chunk.length > 0 socket.write(chunk.length.to_s(16) << CR_NL << chunk << CR_NL) else - socket.write('0' << CR_NL << CR_NL) + socket.write(String.new("0#{CR_NL}#{CR_NL}")) break end end @@ -223,10 +217,15 @@ datum = @data.merge(params) datum[:headers] = @data[:headers].merge(datum[:headers] || {}) + if datum[:user] || datum[:password] + user, pass = Utils.unescape_form(datum[:user].to_s), Utils.unescape_form(datum[:password].to_s) + datum[:headers]['Authorization'] ||= 'Basic ' + ["#{user}:#{pass}"].pack('m').delete(Excon::CR_NL) + end + if datum[:scheme] == UNIX datum[:headers]['Host'] = '' else - datum[:headers]['Host'] ||= '' << datum[:host] << port_string(datum) + datum[:headers]['Host'] ||= datum[:host] + port_string(datum) end datum[:retries_remaining] ||= datum[:retry_limit] @@ -340,11 +339,11 @@ vars[:'@data'][:password] = REDACTED end inspection = '#<Excon::Connection:' - inspection << (object_id << 1).to_s(16) + inspection += (object_id << 1).to_s(16) vars.each do |key, value| - inspection << ' ' << key.to_s << '=' << value.inspect + inspection += " #{key}=#{value.inspect}" end - inspection << '>' + inspection += '>' inspection end @@ -486,8 +485,8 @@ # https credentials happen in handshake if @data[:proxy].has_key?(:user) || @data[:proxy].has_key?(:password) user, pass = Utils.unescape_form(@data[:proxy][:user].to_s), Utils.unescape_form(@data[:proxy][:password].to_s) - auth = ['' << user << ':' << pass].pack('m').delete(Excon::CR_NL) - @data[:headers]['Proxy-Authorization'] = 'Basic ' << auth + auth = ["#{user}:#{pass}"].pack('m').delete(Excon::CR_NL) + @data[:headers]['Proxy-Authorization'] = 'Basic ' + auth end end end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/excon/constants.rb new/lib/excon/constants.rb --- old/lib/excon/constants.rb 2016-07-08 16:19:40.000000000 +0200 +++ new/lib/excon/constants.rb 2016-08-22 23:48:42.000000000 +0200 @@ -1,6 +1,7 @@ +# frozen_string_literal: true module Excon - VERSION = '0.51.0' + VERSION = '0.52.0' CR_NL = "\r\n" @@ -29,9 +30,9 @@ UNIX = 'unix' - USER_AGENT = 'excon/' << VERSION + USER_AGENT = "excon/#{VERSION}" - VERSIONS = USER_AGENT + ' (' << RUBY_PLATFORM << ') ruby/' << RUBY_VERSION + VERSIONS = "#{USER_AGENT} (#{RUBY_PLATFORM}) ruby/#{RUBY_VERSION}" VALID_REQUEST_KEYS = [ :body, diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/excon/error.rb new/lib/excon/error.rb --- old/lib/excon/error.rb 2016-07-08 16:19:40.000000000 +0200 +++ new/lib/excon/error.rb 2016-08-22 23:48:42.000000000 +0200 @@ -1,3 +1,4 @@ +# frozen_string_literal: true module Excon # Excon exception classes class Error < StandardError @@ -36,8 +37,8 @@ or: `Excon.defaults[:ssl_verify_peer] = false` (less secure). EOL - full_message = "#{socket_error.message} (#{socket_error.class})" - full_message << ' ' + msg + full_message = "#{socket_error.message} (#{socket_error.class})" + + ' ' + msg super(full_message) set_backtrace(socket_error.backtrace) @socket_error = socket_error @@ -163,8 +164,8 @@ error_class, error_message = [default_class, 'Unknown'] end message = StringIO.new - str = "Expected(#{request[:expects].inspect}) <=>" - str << " Actual(#{response[:status]} #{error_message})" + str = "Expected(#{request[:expects].inspect}) <=>" + + " Actual(#{response[:status]} #{error_message})" message.puts(str) if request[:debug_request] message.puts('excon.error.request') @@ -201,7 +202,7 @@ klasses.each do |klass| class_name = klass.to_s - unless class_name =~ /Error\Z/ + unless class_name =~ /Error\Z/ class_name = klass.to_s + 'Error' if class_name =~ legacy_re end Excon::Errors.const_set(class_name, Excon::Error.const_get(klass)) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/excon/extensions/uri.rb new/lib/excon/extensions/uri.rb --- old/lib/excon/extensions/uri.rb 2016-07-08 16:19:40.000000000 +0200 +++ new/lib/excon/extensions/uri.rb 2016-08-22 23:48:42.000000000 +0200 @@ -1,3 +1,4 @@ +# frozen_string_literal: true # TODO: Remove this monkey patch once ruby 1.9.3+ is the minimum supported version. # # This patch backports URI#hostname to ruby 1.9.2 and older. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/excon/headers.rb new/lib/excon/headers.rb --- old/lib/excon/headers.rb 2016-07-08 16:19:40.000000000 +0200 +++ new/lib/excon/headers.rb 2016-08-22 23:48:42.000000000 +0200 @@ -1,3 +1,4 @@ +# frozen_string_literal: true module Excon class Headers < Hash diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/excon/middlewares/base.rb new/lib/excon/middlewares/base.rb --- old/lib/excon/middlewares/base.rb 2016-07-08 16:19:40.000000000 +0200 +++ new/lib/excon/middlewares/base.rb 2016-08-22 23:48:42.000000000 +0200 @@ -1,3 +1,4 @@ +# frozen_string_literal: true module Excon module Middleware class Base diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/excon/middlewares/capture_cookies.rb new/lib/excon/middlewares/capture_cookies.rb --- old/lib/excon/middlewares/capture_cookies.rb 2016-07-08 16:19:40.000000000 +0200 +++ new/lib/excon/middlewares/capture_cookies.rb 2016-08-22 23:48:42.000000000 +0200 @@ -1,3 +1,4 @@ +# frozen_string_literal: true module Excon module Middleware class CaptureCookies < Excon::Middleware::Base diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/excon/middlewares/decompress.rb new/lib/excon/middlewares/decompress.rb --- old/lib/excon/middlewares/decompress.rb 2016-07-08 16:19:40.000000000 +0200 +++ new/lib/excon/middlewares/decompress.rb 2016-08-22 23:48:42.000000000 +0200 @@ -1,3 +1,4 @@ +# frozen_string_literal: true module Excon module Middleware class Decompress < Excon::Middleware::Base diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/excon/middlewares/escape_path.rb new/lib/excon/middlewares/escape_path.rb --- old/lib/excon/middlewares/escape_path.rb 2016-07-08 16:19:40.000000000 +0200 +++ new/lib/excon/middlewares/escape_path.rb 2016-08-22 23:48:42.000000000 +0200 @@ -1,3 +1,4 @@ +# frozen_string_literal: true module Excon module Middleware class EscapePath < Excon::Middleware::Base diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/excon/middlewares/expects.rb new/lib/excon/middlewares/expects.rb --- old/lib/excon/middlewares/expects.rb 2016-07-08 16:19:40.000000000 +0200 +++ new/lib/excon/middlewares/expects.rb 2016-08-22 23:48:42.000000000 +0200 @@ -1,3 +1,4 @@ +# frozen_string_literal: true module Excon module Middleware class Expects < Excon::Middleware::Base diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/excon/middlewares/idempotent.rb new/lib/excon/middlewares/idempotent.rb --- old/lib/excon/middlewares/idempotent.rb 2016-07-08 16:19:40.000000000 +0200 +++ new/lib/excon/middlewares/idempotent.rb 2016-08-22 23:48:42.000000000 +0200 @@ -1,3 +1,4 @@ +# frozen_string_literal: true module Excon module Middleware class Idempotent < Excon::Middleware::Base diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/excon/middlewares/instrumentor.rb new/lib/excon/middlewares/instrumentor.rb --- old/lib/excon/middlewares/instrumentor.rb 2016-07-08 16:19:40.000000000 +0200 +++ new/lib/excon/middlewares/instrumentor.rb 2016-08-22 23:48:42.000000000 +0200 @@ -1,3 +1,4 @@ +# frozen_string_literal: true module Excon module Middleware class Instrumentor < Excon::Middleware::Base diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/excon/middlewares/mock.rb new/lib/excon/middlewares/mock.rb --- old/lib/excon/middlewares/mock.rb 2016-07-08 16:19:40.000000000 +0200 +++ new/lib/excon/middlewares/mock.rb 2016-08-22 23:48:42.000000000 +0200 @@ -1,3 +1,4 @@ +# frozen_string_literal: true module Excon module Middleware class Mock < Excon::Middleware::Base diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/excon/middlewares/redirect_follower.rb new/lib/excon/middlewares/redirect_follower.rb --- old/lib/excon/middlewares/redirect_follower.rb 2016-07-08 16:19:40.000000000 +0200 +++ new/lib/excon/middlewares/redirect_follower.rb 2016-08-22 23:48:42.000000000 +0200 @@ -1,3 +1,4 @@ +# frozen_string_literal: true module Excon module Middleware class RedirectFollower < Excon::Middleware::Base diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/excon/middlewares/response_parser.rb new/lib/excon/middlewares/response_parser.rb --- old/lib/excon/middlewares/response_parser.rb 2016-07-08 16:19:40.000000000 +0200 +++ new/lib/excon/middlewares/response_parser.rb 2016-08-22 23:48:42.000000000 +0200 @@ -1,3 +1,4 @@ +# frozen_string_literal: true module Excon module Middleware class ResponseParser < Excon::Middleware::Base diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/excon/pretty_printer.rb new/lib/excon/pretty_printer.rb --- old/lib/excon/pretty_printer.rb 2016-07-08 16:19:40.000000000 +0200 +++ new/lib/excon/pretty_printer.rb 2016-08-22 23:48:42.000000000 +0200 @@ -1,3 +1,4 @@ +# frozen_string_literal: true module Excon class PrettyPrinter def self.pp(io, datum, indent=0) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/excon/response.rb new/lib/excon/response.rb --- old/lib/excon/response.rb 2016-07-08 16:19:40.000000000 +0200 +++ new/lib/excon/response.rb 2016-08-22 23:48:42.000000000 +0200 @@ -1,3 +1,4 @@ +# frozen_string_literal: true module Excon class Response @@ -65,7 +66,7 @@ reason_phrase = line[13..-3] # -3 strips the trailing "\r\n" datum[:response] = { - :body => '', + :body => String.new, :cookies => [], :host => datum[:host], :headers => Excon::Headers.new, diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/excon/socket.rb new/lib/excon/socket.rb --- old/lib/excon/socket.rb 2016-07-08 16:19:40.000000000 +0200 +++ new/lib/excon/socket.rb 2016-08-22 23:48:42.000000000 +0200 @@ -1,3 +1,4 @@ +# frozen_string_literal: true module Excon class Socket include Utils @@ -23,7 +24,7 @@ def initialize(data = {}) @data = data @nonblock = data[:nonblock] - @read_buffer = '' + @read_buffer = String.new @eof = false connect end @@ -40,7 +41,7 @@ def readline return legacy_readline if RUBY_VERSION.to_f <= 1.8_7 - buffer = '' + buffer = String.new begin buffer << @socket.read_nonblock(1) while buffer[-1] != "\n" buffer diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/excon/ssl_socket.rb new/lib/excon/ssl_socket.rb --- old/lib/excon/ssl_socket.rb 2016-07-08 16:19:40.000000000 +0200 +++ new/lib/excon/ssl_socket.rb 2016-08-22 23:48:42.000000000 +0200 @@ -1,3 +1,4 @@ +# frozen_string_literal: true module Excon class SSLSocket < Socket HAVE_NONBLOCK = [:connect_nonblock, :read_nonblock, :write_nonblock].all? do |m| @@ -47,7 +48,7 @@ # workaround issue #257 (JRUBY-6970) ca_file = DEFAULT_CA_FILE - ca_file.gsub!(/^jar:/, '') if ca_file =~ /^jar:file:\// + ca_file = ca_file.gsub(/^jar:/, '') if ca_file =~ /^jar:file:\// begin ssl_context.cert_store.add_file(ca_file) @@ -86,17 +87,17 @@ end if @data[:proxy] - request = 'CONNECT ' << @data[:host] << port_string(@data.merge(:omit_default_port => false)) << Excon::HTTP_1_1 - request << 'Host: ' << @data[:host] << port_string(@data) << Excon::CR_NL + request = "CONNECT #{@data[:host]}#{port_string(@data.merge(:omit_default_port => false))}#{Excon::HTTP_1_1}" + + "Host: #{@data[:host]}#{port_string(@data)}#{Excon::CR_NL}" if @data[:proxy][:password] || @data[:proxy][:user] - auth = ['' << @data[:proxy][:user].to_s << ':' << @data[:proxy][:password].to_s].pack('m').delete(Excon::CR_NL) - request << 'Proxy-Authorization: Basic ' << auth << Excon::CR_NL + auth = ["#{@data[:proxy][:user]}:#{@data[:proxy][:password]}"].pack('m').delete(Excon::CR_NL) + request += "Proxy-Authorization: Basic #{auth}#{Excon::CR_NL}" end - request << 'Proxy-Connection: Keep-Alive' << Excon::CR_NL + request += "Proxy-Connection: Keep-Alive#{Excon::CR_NL}" - request << Excon::CR_NL + request += Excon::CR_NL # write out the proxy setup request @socket.write(request) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/excon/standard_instrumentor.rb new/lib/excon/standard_instrumentor.rb --- old/lib/excon/standard_instrumentor.rb 2016-07-08 16:19:40.000000000 +0200 +++ new/lib/excon/standard_instrumentor.rb 2016-08-22 23:48:42.000000000 +0200 @@ -1,3 +1,4 @@ +# frozen_string_literal: true module Excon class StandardInstrumentor def self.instrument(name, params = {}, &block) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/excon/test/plugin/server/exec.rb new/lib/excon/test/plugin/server/exec.rb --- old/lib/excon/test/plugin/server/exec.rb 1970-01-01 01:00:00.000000000 +0100 +++ new/lib/excon/test/plugin/server/exec.rb 2016-08-22 23:48:42.000000000 +0200 @@ -0,0 +1,23 @@ +module Excon + module Test + module Plugin + module Server + module Exec + def start(app_str = app) + line = '' + open_process(app) + until line =~ /\Aready\Z/ + line = error.gets + fatal_time = elapsed_time > timeout + if fatal_time + msg = "executable #{app} has taken too long to start" + raise msg + end + end + true + end + end + end + end + end +end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/excon/test/plugin/server/puma.rb new/lib/excon/test/plugin/server/puma.rb --- old/lib/excon/test/plugin/server/puma.rb 1970-01-01 01:00:00.000000000 +0100 +++ new/lib/excon/test/plugin/server/puma.rb 2016-08-22 23:48:42.000000000 +0200 @@ -0,0 +1,21 @@ +module Excon + module Test + module Plugin + module Server + module Puma + def start(app_str = app, bind_uri = bind) + bind.host = bind_uri.host.gsub(/[\[\]]/, '') + open_process('puma', '-b', bind_uri.to_s, app_str) + line = '' + until line =~ /Use Ctrl-C to stop/ + line = read.gets + fatal_time = elapsed_time > timeout + raise 'puma server has taken too long to start' if fatal_time + end + true + end + end + end + end + end +end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/excon/test/plugin/server/unicorn.rb new/lib/excon/test/plugin/server/unicorn.rb --- old/lib/excon/test/plugin/server/unicorn.rb 1970-01-01 01:00:00.000000000 +0100 +++ new/lib/excon/test/plugin/server/unicorn.rb 2016-08-22 23:48:42.000000000 +0200 @@ -0,0 +1,35 @@ +module Excon + module Test + module Plugin + module Server + module Unicorn + def start(app_str = app, bind_uri = bind) + bind_uri = URI.parse(bind_uri) unless bind_uri.is_a? URI::Generic + is_unix_socket = (bind_uri.scheme == "unix") + if is_unix_socket + bind_str = bind_uri.to_s + else + host = bind_uri.host.gsub(/[\[\]]/, '') + bind_str = "#{host}:#{bind_uri.port}" + end + args = [ + 'unicorn', + '--no-default-middleware', + '-l', + bind_str, + app_str + ] + open_process(*args) + line = '' + until line =~ /worker\=0 ready/ + line = error.gets + fatal_time = elapsed_time > timeout + raise 'unicorn server has taken too long to start' if fatal_time + end + true + end + end + end + end + end +end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/excon/test/plugin/server/webrick.rb new/lib/excon/test/plugin/server/webrick.rb --- old/lib/excon/test/plugin/server/webrick.rb 1970-01-01 01:00:00.000000000 +0100 +++ new/lib/excon/test/plugin/server/webrick.rb 2016-08-22 23:48:42.000000000 +0200 @@ -0,0 +1,23 @@ +module Excon + module Test + module Plugin + module Server + module Webrick + def start(app_str = app, bind_uri = bind) + bind_uri = URI.parse(bind_uri) unless bind_uri.is_a? URI::Generic + host = bind_uri.host.gsub(/[\[\]]/, '') + port = bind_uri.port.to_s + open_process('rackup', '-s', 'webrick', '--host', host, '--port', port, app_str) + line = '' + until line =~ /HTTPServer#start/ + line = error.gets + fatal_time = elapsed_time > timeout + raise 'webrick server has taken too long to start' if fatal_time + end + true + end + end + end + end + end +end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/excon/test/server.rb new/lib/excon/test/server.rb --- old/lib/excon/test/server.rb 1970-01-01 01:00:00.000000000 +0100 +++ new/lib/excon/test/server.rb 2016-08-22 23:48:42.000000000 +0200 @@ -0,0 +1,107 @@ +require 'open4' +require 'excon' +require 'excon/test/plugin/server/webrick' +require 'excon/test/plugin/server/unicorn' +require 'excon/test/plugin/server/puma' +require 'excon/test/plugin/server/exec' + + +module Excon + module Test + class Server + attr_accessor :app, :server, :bind, :pid, :read, :write, :error, :started_at, :timeout + + # Methods that must be implemented by a plugin + INSTANCE_REQUIRES = [:start] + Excon.defaults.merge!( + connect_timeout: 5, + read_timeout: 5, + write_timeout: 5 + ) + + def initialize(args) + # TODO: Validate these args + @server = args.keys.first + @app = args[server] + args[:bind] ||= 'tcp://127.0.0.1:9292' + @bind = URI.parse(args[:bind]) + @is_unix_socket = (@bind.scheme == 'unix') + @bind.host = @bind.host.gsub(/[\[\]]/, '') unless @is_unix_socket + if args[:timeout] + @timeout = args[:timeout] + else + # Double the default timeout if jruby because of the startup cost + @timeout = RUBY_PLATFORM == "java" ? 20 : 10 + end + name = @server.to_s.split('_').collect(&:capitalize).join + plug = nested_const_get("Excon::Test::Plugin::Server::#{name}") + self.extend plug + check_implementation(plug) + end + + def open_process(*args) + if RUBY_PLATFORM == 'java' + @pid, @write, @read, @error = IO.popen4(*args) + else + GC.disable if RUBY_VERSION < '1.9' + @pid, @write, @read, @error = Open4.popen4(*args) + end + @started_at = Time.now + end + + def elapsed_time + Time.now - started_at + end + + def stop + if RUBY_PLATFORM == 'java' + Process.kill('USR1', pid) + else + Process.kill(9, pid) + GC.enable if RUBY_VERSION < '1.9' + Process.wait(pid) + end + + if @is_unix_socket + socket = @bind.path + File.delete(socket) if File.exist?(socket) + end + + # TODO: Ensure process is really dead + dump_errors + true + end + def dump_errors + lines = error.read.split($INPUT_RECORD_SEPARATOR) + while line = lines.shift + case line + when /(ERROR|Error)/ + unless line =~ /(null cert chain|did not return a certificate|SSL_read:: internal error)/ + in_err = true + puts + end + when /^(127|localhost)/ + in_err = false + end + puts line if in_err + end + end + + private + + def nested_const_get(namespace) + namespace.split('::').inject(Object) do |mod, klass| + mod.const_get(klass) + end + end + + def check_implementation(plug) + INSTANCE_REQUIRES.each do |m| + unless self.respond_to? m + raise "FATAL: #{plug} does not implement ##{m}" + end + end + end + end + end +end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/excon/unix_socket.rb new/lib/excon/unix_socket.rb --- old/lib/excon/unix_socket.rb 2016-07-08 16:19:40.000000000 +0200 +++ new/lib/excon/unix_socket.rb 2016-08-22 23:48:42.000000000 +0200 @@ -1,3 +1,4 @@ +# frozen_string_literal: true module Excon class UnixSocket < Excon::Socket diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/excon/utils.rb new/lib/excon/utils.rb --- old/lib/excon/utils.rb 2016-07-08 16:19:40.000000000 +0200 +++ new/lib/excon/utils.rb 2016-08-22 23:48:42.000000000 +0200 @@ -1,3 +1,4 @@ +# frozen_string_literal: true module Excon module Utils extend self @@ -14,26 +15,26 @@ raise ArgumentError, '`datum` must be given unless called on a Connection' end if datum[:scheme] == UNIX - '' << datum[:scheme] << '://' << datum[:socket] + "#{datum[:scheme]}://#{datum[:socket]}" else - '' << datum[:scheme] << '://' << datum[:host] << port_string(datum) + "#{datum[:scheme]}://#{datum[:host]}#{port_string(datum)}" end end def request_uri(datum) - connection_uri(datum) << datum[:path] << query_string(datum) + connection_uri(datum) + datum[:path] + query_string(datum) end def port_string(datum) if datum[:port].nil? || (datum[:omit_default_port] && ((datum[:scheme].casecmp('http') == 0 && datum[:port] == 80) || (datum[:scheme].casecmp('https') == 0 && datum[:port] == 443))) '' else - ':' << datum[:port].to_s + ':' + datum[:port].to_s end end def query_string(datum) - str = '' + str = String.new case datum[:query] when String str << '?' << datum[:query] diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/excon.rb new/lib/excon.rb --- old/lib/excon.rb 2016-07-08 16:19:40.000000000 +0200 +++ new/lib/excon.rb 2016-08-22 23:48:42.000000000 +0200 @@ -1,3 +1,4 @@ +# frozen_string_literal: true $:.unshift(File.dirname(__FILE__)) unless $:.include?(File.dirname(__FILE__)) || $:.include?(File.expand_path(File.dirname(__FILE__))) @@ -55,7 +56,7 @@ def display_warning(warning) # Show warning if $VERBOSE or ENV['EXCON_DEBUG'] is set if $VERBOSE || ENV['EXCON_DEBUG'] - $stderr.puts '[excon][WARNING] ' << warning << "\n#{ caller.join("\n") }" + $stderr.puts "[excon][WARNING] #{warning}\n#{ caller.join("\n") }" end end @@ -149,7 +150,7 @@ if uri.user || uri.password request_params[:headers] ||= {} user, pass = Utils.unescape_form(uri.user.to_s), Utils.unescape_form(uri.password.to_s) - request_params[:headers]['Authorization'] ||= 'Basic ' << ['' << user << ':' << pass].pack('m').delete(Excon::CR_NL) + request_params[:headers]['Authorization'] ||= 'Basic ' + ["#{user}:#{pass}"].pack('m').delete(Excon::CR_NL) end end if request_params.has_key?(:headers) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/metadata new/metadata --- old/metadata 2016-07-08 16:19:40.000000000 +0200 +++ new/metadata 2016-08-22 23:48:42.000000000 +0200 @@ -1,7 +1,7 @@ --- !ruby/object:Gem::Specification name: excon version: !ruby/object:Gem::Version - version: 0.51.0 + version: 0.52.0 platform: ruby authors: - dpiddy (Dan Peterson) @@ -10,9 +10,23 @@ autorequire: bindir: bin cert_chain: [] -date: 2016-07-08 00:00:00.000000000 Z +date: 2016-08-22 00:00:00.000000000 Z dependencies: - !ruby/object:Gem::Dependency + name: rspec + requirement: !ruby/object:Gem::Requirement + requirements: + - - ">=" + - !ruby/object:Gem::Version + version: 3.5.0 + type: :development + prerelease: false + version_requirements: !ruby/object:Gem::Requirement + requirements: + - - ">=" + - !ruby/object:Gem::Version + version: 3.5.0 +- !ruby/object:Gem::Dependency name: activesupport requirement: !ruby/object:Gem::Requirement requirements: @@ -208,8 +222,16 @@ - lib/excon/socket.rb - lib/excon/ssl_socket.rb - lib/excon/standard_instrumentor.rb +- lib/excon/test/plugin/server/exec.rb +- lib/excon/test/plugin/server/puma.rb +- lib/excon/test/plugin/server/unicorn.rb +- lib/excon/test/plugin/server/webrick.rb +- lib/excon/test/server.rb - lib/excon/unix_socket.rb - lib/excon/utils.rb +- spec/excon_spec.rb +- spec/excon_test_server_spec.rb +- spec/spec_helper.rb - tests/authorization_header_tests.rb - tests/bad_tests.rb - tests/basic_tests.rb diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/spec/excon_spec.rb new/spec/excon_spec.rb --- old/spec/excon_spec.rb 1970-01-01 01:00:00.000000000 +0100 +++ new/spec/excon_spec.rb 2016-08-22 23:48:42.000000000 +0200 @@ -0,0 +1,7 @@ +require 'spec_helper' + +describe Excon do + it 'has a version number' do + expect(Excon::VERSION).not_to be nil + end +end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/spec/excon_test_server_spec.rb new/spec/excon_test_server_spec.rb --- old/spec/excon_test_server_spec.rb 1970-01-01 01:00:00.000000000 +0100 +++ new/spec/excon_test_server_spec.rb 2016-08-22 23:48:42.000000000 +0200 @@ -0,0 +1,51 @@ +require 'spec_helper' + +# The variable file should be renamed to something better - starbelly +shared_examples_for "a web server" do |plugin, file, bind_str = nil| + plugin = plugin.to_sym unless plugin.is_a? Symbol + + if plugin == :unicorn && RUBY_PLATFORM == "java" + before { skip("until unicorn supports jruby") } + end + + abs_file = Object.send("#{plugin}_path", file) + instance = nil + args = { plugin => abs_file} + args[:bind] = bind_str unless bind_str.nil? + + it "returns an instance" do + instance = Excon::Test::Server.new(args) + expect(instance).to be_instance_of Excon::Test::Server + end + + it 'starts the server' do + expect(instance.start).to be true + end + + it 'stops the server' do + expect(instance.stop).to be true + end +end + +describe Excon::Test::Server do + context 'when webrick' do + it_should_behave_like "a web server", :webrick, 'basic.ru' + end + + context 'when unicorn' do + it_should_behave_like "a web server", :unicorn, 'streaming.ru' + end + + context "when unicorn is given a unix socket uri" do + socket_uri = 'unix:///tmp/unicorn.socket' + it_should_behave_like "a web server", :unicorn, 'streaming.ru', socket_uri + end + + context 'when puma' do + it_should_behave_like "a web server", :puma, 'streaming.ru' + end + + context 'when executable' do + it_should_behave_like "a web server", :exec, 'good.rb' + end +end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/spec/spec_helper.rb new/spec/spec_helper.rb --- old/spec/spec_helper.rb 1970-01-01 01:00:00.000000000 +0100 +++ new/spec/spec_helper.rb 2016-08-22 23:48:42.000000000 +0200 @@ -0,0 +1,126 @@ +require 'excon' +require 'excon/test/server' + +# This file was generated by the `rspec --init` command. Conventionally, all +# specs live under a `spec` directory, which RSpec adds to the `$LOAD_PATH`. +# The generated `.rspec` file contains `--require spec_helper` which will cause +# this file to always be loaded, without a need to explicitly require it in any +# files. +# +# Given that it is always loaded, you are encouraged to keep this file as +# light-weight as possible. Requiring heavyweight dependencies from this file +# will add to the boot time of your test suite on EVERY test run, even for an +# individual file that may not need all of that loaded. Instead, consider making +# a separate helper file that requires the additional dependencies and performs +# the additional setup, and require it from the spec files that actually need +# it. +# +# The `.rspec` file also contains a few flags that are not defaults but that +# users commonly want. +# +# See http://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration +RSpec.configure do |config| + # rspec-expectations config goes here. You can use an alternate + # assertion/expectation library such as wrong or the stdlib/minitest + # assertions if you prefer. + config.expect_with :rspec do |expectations| + # This option will default to `true` in RSpec 4. It makes the `description` + # and `failure_message` of custom matchers include text for helper methods + # defined using `chain`, e.g.: + # be_bigger_than(2).and_smaller_than(4).description + # # => "be bigger than 2 and smaller than 4" + # ...rather than: + # # => "be bigger than 2" + expectations.include_chain_clauses_in_custom_matcher_descriptions = true + end + + # rspec-mocks config goes here. You can use an alternate test double + # library (such as bogus or mocha) by changing the `mock_with` option here. + config.mock_with :rspec do |mocks| + # Prevents you from mocking or stubbing a method that does not exist on + # a real object. This is generally recommended, and will default to + # `true` in RSpec 4. + mocks.verify_partial_doubles = true + end + + # This option will default to `:apply_to_host_groups` in RSpec 4 (and will + # have no way to turn it off -- the option exists only for backwards + # compatibility in RSpec 3). It causes shared context metadata to be + # inherited by the metadata hash of host groups and examples, rather than + # triggering implicit auto-inclusion in groups with matching metadata. + config.shared_context_metadata_behavior = :apply_to_host_groups + +# The settings below are suggested to provide a good initial experience +# with RSpec, but feel free to customize to your heart's content. +=begin + # This allows you to limit a spec run to individual examples or groups + # you care about by tagging them with `:focus` metadata. When nothing + # is tagged with `:focus`, all examples get run. RSpec also provides + # aliases for `it`, `describe`, and `context` that include `:focus` + # metadata: `fit`, `fdescribe` and `fcontext`, respectively. + config.filter_run_when_matching :focus + + # Allows RSpec to persist some state between runs in order to support + # the `--only-failures` and `--next-failure` CLI options. We recommend + # you configure your source control system to ignore this file. + config.example_status_persistence_file_path = "spec/examples.txt" + + # Limits the available syntax to the non-monkey patched syntax that is + # recommended. For more details, see: + # - http://rspec.info/blog/2012/06/rspecs-new-expectation-syntax/ + # - http://www.teaisaweso.me/blog/2013/05/27/rspecs-new-message-expectation-syntax/ + # - http://rspec.info/blog/2014/05/notable-changes-in-rspec-3/#zero-monkey-patching-mode + config.disable_monkey_patching! + + # This setting enables warnings. It's recommended, but in some cases may + # be too noisy due to issues in dependencies. + config.warnings = true + + # Many RSpec users commonly either run the entire suite or an individual + # file, and it's useful to allow more verbose output when running an + # individual spec file. + if config.files_to_run.one? + # Use the documentation formatter for detailed output, + # unless a formatter has already been configured + # (e.g. via a command-line flag). + config.default_formatter = 'doc' + end + + # Print the 10 slowest examples and example groups at the + # end of the spec run, to help surface which specs are running + # particularly slow. + config.profile_examples = 10 + + # Run specs in random order to surface order dependencies. If you find an + # order dependency and want to debug it, you can fix the order by providing + # the seed, which is printed after each run. + # --seed 1234 + config.order = :random + + # Seed global randomization in this process using the `--seed` CLI option. + # Setting this allows you to use `--seed` to deterministically reproduce + # test failures related to randomization by passing the same `--seed` value + # as the one that triggered the failure. + Kernel.srand config.seed +=end + +end + +# Todo: s/tests/specs when migration is complete +def get_abs_path(*parts) + File.join(File.expand_path('../..', __FILE__), 'tests', *parts) +end + +def rackup_path(*parts) + get_abs_path('rackups', *parts) +end + +def webrick_path(*parts) rackup_path(*parts); end + +def unicorn_path(*parts) rackup_path(*parts); end + +def puma_path(*parts) rackup_path(*parts); end + +def exec_path(*parts) + get_abs_path('servers', *parts) +end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/tests/authorization_header_tests.rb new/tests/authorization_header_tests.rb --- old/tests/authorization_header_tests.rb 2016-07-08 16:19:40.000000000 +0200 +++ new/tests/authorization_header_tests.rb 2016-08-22 23:48:42.000000000 +0200 @@ -14,10 +14,6 @@ !conn.inspect.include?(auth_header) end - test("authorization header remains correct for #{desc}") do - conn.data[:headers]['Authorization'] == auth_header - end - if conn.data[:password] test("password param concealed for #{desc}") do !conn.inspect.include?(conn.data[:password]) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/tests/basic_tests.rb new/tests/basic_tests.rb --- old/tests/basic_tests.rb 2016-07-08 16:19:40.000000000 +0200 +++ new/tests/basic_tests.rb 2016-08-22 23:48:42.000000000 +0200 @@ -91,10 +91,23 @@ Shindo.tests('Excon basics (Basic Auth Pass)') do with_rackup('basic_auth.ru') do basic_tests('http://test_user:test_password@127.0.0.1:9292') + user, pass, uri = ['test_user', 'test_password', 'http://127.0.0.1:9292'].map(&:freeze) + tests('with frozen args').returns(200) do - user, pass, uri = ['test_user', 'test_password', 'http://127.0.0.1:9292'].map(&:freeze) - connection = Excon.new(uri, :user => user, :password => pass ) - response = connection.request(:method => :get, :path => '/content-length/100') + connection = Excon.new(uri, :method => :get, :password => pass, :path => '/content-length/100', :user => user) + response = connection.request + response.status + end + + tests('with user/pass on request').returns(200) do + connection = Excon.new(uri, :method => :get, :path => '/content-length/100') + response = connection.request(:user => user, :password => pass) + response.status + end + + tests('with user/pass on connection and request').returns(200) do + connection = Excon.new(uri, :method => :get, :password => 'incorrect_password', :path => '/content-length/100', :user => 'incorrect_user') + response = connection.request(user: user, password: pass) response.status end end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/tests/middlewares/instrumentation_tests.rb new/tests/middlewares/instrumentation_tests.rb --- old/tests/middlewares/instrumentation_tests.rb 2016-07-08 16:19:40.000000000 +0200 +++ new/tests/middlewares/instrumentation_tests.rb 2016-08-22 23:48:42.000000000 +0200 @@ -173,6 +173,8 @@ tests('authorization header REDACT') do + @auth_header = 'Basic dXNlcjpwYXNz' + begin original_stderr = $stderr $stderr = @captured_stderr = StringIO.new @@ -180,6 +182,9 @@ raises(Excon::Errors::SocketError) do @connection = Excon.new( 'http://user:pass@127.0.0.1:9292', + :headers => { + 'Authorization' => @auth_header + }, :instrumentor => Excon::StandardInstrumentor, :mock => true ) @@ -189,8 +194,6 @@ $stderr = original_stderr end - @auth_header = 'Basic dXNlcjpwYXNz' - test('does not appear in response') do !@captured_stderr.string.include?(@auth_header) end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/tests/test_helper.rb new/tests/test_helper.rb --- old/tests/test_helper.rb 2016-07-08 16:19:40.000000000 +0200 +++ new/tests/test_helper.rb 2016-08-22 23:48:42.000000000 +0200 @@ -234,9 +234,9 @@ def with_rackup(name, host="127.0.0.1") unless RUBY_PLATFORM == 'java' GC.disable if RUBY_VERSION < '1.9' - pid, w, r, e = Open4.popen4("rackup", "--host", host, rackup_path(name)) + pid, w, r, e = Open4.popen4("rackup", "-s", "webrick", "--host", host, rackup_path(name)) else - pid, w, r, e = IO.popen4("rackup", "--host", host, rackup_path(name)) + pid, w, r, e = IO.popen4("rackup", "-s", "webrick", "--host", host, rackup_path(name)) end until e.gets =~ /HTTPServer#start:/; end yield