Commit 60489671 authored by Cédric Boutillier's avatar Cédric Boutillier

refresh, add, remove patches

- drop fix_tests_ruby2.0.patch and require_mocha_setup.patch, integrated
  upstream
- add fix_print_file_string_options_deprecation_warning.patch
- add no_bundler_simplecov.patch
parent d5e66c6c
...@@ -2,7 +2,7 @@ Description: deactivate tests using test/fixtures/google_response_* ...@@ -2,7 +2,7 @@ Description: deactivate tests using test/fixtures/google_response_*
those files have been deleted when repacking those files have been deleted when repacking
Forwarded: not-needed Forwarded: not-needed
Author: Cédric Boutillier <boutil@debian.org> Author: Cédric Boutillier <boutil@debian.org>
Last-Update: 2013-10-04 Last-Update: 2014-05-02
--- a/test/test_fake_web.rb --- a/test/test_fake_web.rb
+++ b/test/test_fake_web.rb +++ b/test/test_fake_web.rb
...@@ -23,7 +23,7 @@ Last-Update: 2013-10-04 ...@@ -23,7 +23,7 @@ Last-Update: 2013-10-04
FakeWeb.register_uri(:post, 'http://www.google.com/', :response => fixture_path("google_response_without_transfer_encoding")) FakeWeb.register_uri(:post, 'http://www.google.com/', :response => fixture_path("google_response_without_transfer_encoding"))
response = Net::HTTP.start('www.google.com') { |query| query.post('/', '') } response = Net::HTTP.start('www.google.com') { |query| query.post('/', '') }
assert_equal "200", response.code assert_equal "200", response.code
@@ -498,21 +498,21 @@ @@ -505,21 +505,21 @@
4.times { assert_equal 'ever_more', Net::HTTP.get(uri) } 4.times { assert_equal 'ever_more', Net::HTTP.get(uri) }
end end
...@@ -48,8 +48,8 @@ Last-Update: 2013-10-04 ...@@ -48,8 +48,8 @@ Last-Update: 2013-10-04
FakeWeb.register_uri(:get, 'http://www.google.com/', :response => fixture_path("google_response_from_curl")) FakeWeb.register_uri(:get, 'http://www.google.com/', :response => fixture_path("google_response_from_curl"))
response = Net::HTTP.start('www.google.com') { |query| query.get('/') } response = Net::HTTP.start('www.google.com') { |query| query.get('/') }
assert_not_nil response['transfer-encoding'] assert_not_nil response['transfer-encoding']
@@ -564,7 +564,7 @@ @@ -580,7 +580,7 @@
assert_equal "test example content", response.body assert_equal options_before_request, options
end end
- def test_registering_with_a_response_pointing_to_a_pathname - def test_registering_with_a_response_pointing_to_a_pathname
......
Description: fix detection of external caller for deprecation warnings
take into account Debian installation path for Ruby libraries.
Origin: vendor
Author: Cédric Boutillier <boutil@debian.org>
Last-Update: 2014-05-02
--- a/lib/fake_web/responder.rb
+++ b/lib/fake_web/responder.rb
@@ -116,7 +116,7 @@
def print_file_string_options_deprecation_warning
which = options.has_key?(:file) ? :file : :string
- first_external_caller = caller.detect { |line| !line.include?("/lib/fake_web") }
+ first_external_caller = caller.detect { |line| !line.include?("/vendor_ruby/fake_web") }
$stderr.puts
$stderr.puts "Deprecation warning: FakeWeb's :#{which} option has been renamed to :body."
$stderr.puts "Just replace :#{which} with :body in your FakeWeb.register_uri calls."
From ac856c369445631118f4a51f73793af1ea5c5e1a Mon Sep 17 00:00:00 2001
Description: Update test suite for Ruby 2
Author: Josef Stribny <jstribny@redhat.com>
Origin: https://github.com/chrisk/fakeweb/commit/ae0e2d9ce0da577262febed92e44b7a87617b88f.patch
Bug: https://github.com/chrisk/fakeweb/pull/37
Reviewed-by: Cédric Boutillier <boutil@debian.org>
Last-update: 2013-02-28
--- a/test/test_helper.rb
+++ b/test/test_helper.rb
@@ -54,12 +54,18 @@
OpenSSL::SSL::SSLSocket.expects(:new).with(socket, instance_of(OpenSSL::SSL::SSLContext)).returns(socket).at_least_once
socket.stubs(:sync_close=).returns(true)
socket.expects(:connect).with().at_least_once
+ socket.expects(:session).with().at_least_once if RUBY_VERSION >= "2.0.0"
else
socket = mock("TCPSocket")
Socket.expects(:===).with(socket).at_least_once.returns(true)
end
- TCPSocket.expects(:open).with(options[:host], options[:port]).returns(socket).at_least_once
+ if RUBY_VERSION >= "2.0.0"
+ TCPSocket.expects(:open).with(options[:host], options[:port], nil, nil).returns(socket).at_least_once
+ else
+ TCPSocket.expects(:open).with(options[:host], options[:port]).returns(socket).at_least_once
+ end
+
socket.stubs(:closed?).returns(false)
socket.stubs(:close).returns(true)
Description: do not use bundler or simplecov in tests
Origin: vendor
Author: Cédric Boutillier <boutil@debian.org>
Forwarded: not-needed
Last-Update: 2014-05-02
--- a/test/test_helper.rb
+++ b/test/test_helper.rb
@@ -1,9 +1,3 @@
-require 'rubygems'
-require 'bundler'
-Bundler.setup
-
-require 'helpers/start_simplecov'
-
require 'test/unit'
require 'open-uri'
require 'pathname'
--- a/test/test_other_net_http_libraries.rb
+++ b/test/test_other_net_http_libraries.rb
@@ -25,29 +25,29 @@
# start one process per test. The original process (comprising
# the rest of the tests) will just get the default name
# "Unit Tests".
- simplecov_code = "SIMPLECOV_COMMAND_NAME = '#{current_test_name}'; require 'helpers/start_simplecov'"
+ #simplecov_code = "SIMPLECOV_COMMAND_NAME = '#{current_test_name}'; require 'helpers/start_simplecov'"
- output = `#{ruby_path} #{current_ruby_opts.join(' ')} #{load_path_opts} -e "#{simplecov_code}; #{requires}; #{additional_code}" 2>&1`
+ #output = `#{ruby_path} #{current_ruby_opts.join(' ')} #{load_path_opts} -e "#{simplecov_code}; #{requires}; #{additional_code}" 2>&1`
remove_warnings_from_gems_and_stdlib(output)
end
- def test_requiring_samuel_before_fakeweb_prints_warning
+ def _test_requiring_samuel_before_fakeweb_prints_warning
output = capture_output_from_requiring %w(samuel fakeweb)
assert_match %r(Warning: FakeWeb was loaded after Samuel), output
end
- def test_requiring_samuel_after_fakeweb_does_not_print_warning
+ def _test_requiring_samuel_after_fakeweb_does_not_print_warning
output = capture_output_from_requiring %w(fakeweb samuel)
assert_empty output
end
- def test_requiring_right_http_connection_before_fakeweb_and_then_connecting_does_not_print_warning
+ def _test_requiring_right_http_connection_before_fakeweb_and_then_connecting_does_not_print_warning
additional_code = "Net::HTTP.start('example.com')"
output = capture_output_from_requiring %w(right_http_connection fakeweb), additional_code
assert_empty output
end
- def test_requiring_right_http_connection_after_fakeweb_and_then_connecting_prints_warning
+ def _test_requiring_right_http_connection_after_fakeweb_and_then_connecting_prints_warning
additional_code = "Net::HTTP.start('example.com')"
output = capture_output_from_requiring %w(fakeweb right_http_connection), additional_code
assert_match %r(Warning: RightHttpConnection was loaded after FakeWeb), output
Description: Require mocha/setup instead of mocha
This is the way to ensure Mocha is correctly setup for recent versions.
Origin: vendor
Author: Cédric Boutillier <boutil.debian.org>
Bug: https://github.com/chrisk/fakeweb/issues/46
Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=741760
Last-Update: 2014-03-16
--- ruby-fakeweb-1.3.0+dfsg1.orig/test/test_helper.rb
+++ ruby-fakeweb-1.3.0+dfsg1/test/test_helper.rb
@@ -4,7 +4,7 @@ require 'pathname'
require 'fake_web'
require 'rbconfig'
require 'rubygems'
-require 'mocha'
+require 'mocha/setup'
# Give all tests a common setup and teardown that prevents shared state
fix_tests_ruby2.0.patch
deactivate_google_tests.patch deactivate_google_tests.patch
require_mocha_setup.patch no_bundler_simplecov.patch
fix_print_file_string_options_deprecation_warning.patch
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment