debian/0000755000000000000000000000000012256076707007202 5ustar debian/ruby-fakeweb.docs0000644000000000000000000000001412247157014012421 0ustar README.rdoc debian/repack.sh0000755000000000000000000000211312247157014010772 0ustar #!/bin/sh # Repackage upstream source to exclude non-distributable files # should be called as "repack.sh --upstream-source # (for example, via uscan) set -e set -u VER="$2+dfsg1" FILE="$3" PKG=`dpkg-parsechangelog|grep ^Source:|sed 's/^Source: //'` REPACK_DIR="$PKG-$VER.orig" # DevRef § 6.7.8.2 DEST_DIR=$(dirname "$FILE") echo -e "\nRepackaging $FILE\n" DIR=`mktemp -d ./tmpRepackXXXXXX` trap "rm -rf \"$DIR\"" QUIT INT EXIT # Create an extra directory to cope with rootless tarballs UP_BASE="$DIR/unpack" mkdir "$UP_BASE" tar xzf "$FILE" -C "$UP_BASE" if [ `ls -1 "$UP_BASE" | wc -l` -eq 1 ]; then # Tarball does contain a root directory UP_BASE="$UP_BASE/`ls -1 "$UP_BASE"`" fi ## Remove stuff rm -vfr $UP_BASE/test/vendor rm -vf $UP_BASE/test/fixtures/google_response* ## End mv "$UP_BASE" "$DIR/$REPACK_DIR" # Using a pipe hides tar errors! tar cfC "$DIR/repacked.tar" "$DIR" "$REPACK_DIR" gzip -9 < "$DIR/repacked.tar" > "$DIR/repacked.tar.gz" FILE="${DEST_DIR}/${PKG}_${VER}.orig.tar.gz" mv "$DIR/repacked.tar.gz" "$FILE" echo "*** $FILE repackaged" debian/copyright0000644000000000000000000000315312247157014011126 0ustar Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ Upstream-Name: fakeweb Source: http://rubygems.org/gems/fakeweb Comment: the upstream tarball has been repacked to remove the following files: test/vendor containing files provided by ruby-samuel and ruby-right-http-connection test/fixtures/google_response_* containing minified javascript response from Google homepage Files: * Copyright: 2006-2010 Blaine Cook, Chris Kampmeier, and other contributors License: Expat Files: debian/* Copyright: 2013 Minto Joseph License: Expat License: Expat Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: . The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. . THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTW debian/rules0000755000000000000000000000070112176035211010242 0ustar #!/usr/bin/make -f #export DH_VERBOSE=1 # # Uncomment to ignore all test failures (but the tests will run anyway) #export DH_RUBY_IGNORE_TESTS=all # # Uncomment to ignore some test failures (but the tests will run anyway). # Valid values: #export DH_RUBY_IGNORE_TESTS=ruby1.8 ruby1.9.1 require-rubygems # # If you need to specify the .gemspec (eg there is more than one) #export DH_RUBY_GEMSPEC=gem.gemspec %: dh $@ --buildsystem=ruby --with ruby debian/gbp.conf0000644000000000000000000000005312176035211010601 0ustar [git-import-orig] filter-pristine-tar=true debian/source/0000755000000000000000000000000012176035211010464 5ustar debian/source/format0000644000000000000000000000001412176035211011672 0ustar 3.0 (quilt) debian/control0000644000000000000000000000164412256076605010607 0ustar Source: ruby-fakeweb Section: ruby Priority: optional Maintainer: Debian Ruby Extras Maintainers Uploaders: Minto Joseph , Cédric Boutillier Build-Depends: debhelper (>= 7.0.50~), gem2deb (>= 0.3.1~), ruby-samuel, ruby-mocha, ruby-http-connection Standards-Version: 3.9.5 Vcs-Git: git://anonscm.debian.org/pkg-ruby-extras/ruby-fakeweb.git Vcs-Browser: http://anonscm.debian.org/gitweb/?p=pkg-ruby-extras/ruby-fakeweb.git;a=summary Homepage: http://github.com/chrisk/fakeweb XS-Ruby-Versions: all Package: ruby-fakeweb Architecture: all XB-Ruby-Versions: ${ruby:Versions} Depends: ${shlibs:Depends}, ${misc:Depends}, ruby | ruby-interpreter Description: tool for faking responses to HTTP requests FakeWeb is a helper for faking web requests in Ruby. It works at a global level, without modifying code or writing extensive stubs. debian/README.source0000644000000000000000000000063512247157014011354 0ustar This package uses the Debian 3.0 (quilt) source package format. The upstream tarball has been repacked to remove the bundled libraries right_http_connection and samuel from test/vendor/, as well as test/fixtures/google_response_* containing minified javascript code from Google homepage. The repacking is achieved with the debian/repack.sh script. Minto Joseph Last Update: 2013-10-04 debian/ruby-tests.rb0000644000000000000000000000072612176035211011637 0ustar # FIXME # there's a spec/ or a test/ directory in the upstream source, but # no test suite was defined in the Gem specification. It would be # a good idea to define it here so the package gets tested at build time. # Examples: $: << 'test' << '.' Dir['{test}/**/*.rb'].each { |f| require f } # # require 'test/ts_foo.rb' # # require 'rbconfig' # ruby = File.join(RbConfig::CONFIG['bindir'], RbConfig::CONFIG['ruby_install_name']) # exec("#{ruby} -I. test/runtests.rb") debian/watch0000644000000000000000000000024412247157014010222 0ustar version=3 opts=dversionmangle=s/\+dfsg(\d)*// \ http://pkg-ruby-extras.alioth.debian.org/cgi-bin/gemwatch/fakeweb .*/fakeweb-(.*).tar.gz debian sh debian/repack.sh debian/changelog0000644000000000000000000000133712256076707011060 0ustar ruby-fakeweb (1.3.0+dfsg1-2) unstable; urgency=medium * Team upload. * Depend on "better" version of duplicate http-connection gem * Bump Standards-Version to 3.9.5 (no changes) -- Christian Hofstaedtler Mon, 23 Dec 2013 19:14:47 +0100 ruby-fakeweb (1.3.0+dfsg1-1) unstable; urgency=low * repack again the tarball + really remove test/fixtures/google_response_* * add deactivate_google_tests.patch: deactivate all patches using those removed files. -- Cédric Boutillier Fri, 04 Oct 2013 18:08:44 +0200 ruby-fakeweb (1.3.0+dfsg-1) unstable; urgency=low * Initial release (Closes: #710786) -- Cédric Boutillier Fri, 04 Oct 2013 17:13:27 +0200 debian/compat0000644000000000000000000000000212176035211010362 0ustar 7 debian/patches/0000755000000000000000000000000012247157014010620 5ustar debian/patches/deactivate_google_tests.patch0000644000000000000000000000704512247157014016536 0ustar Description: deactivate tests using test/fixtures/google_response_* those files have been deleted when repacking Forwarded: not-needed Author: Cédric Boutillier Last-Update: 2013-10-04 --- a/test/test_fake_web.rb +++ b/test/test_fake_web.rb @@ -314,14 +314,14 @@ assert_equal fake_response, response end - def test_mock_get_with_request_from_file_as_registered_uri + def _test_mock_get_with_request_from_file_as_registered_uri FakeWeb.register_uri(:get, 'http://www.google.com/', :response => fixture_path("google_response_without_transfer_encoding")) response = Net::HTTP.start('www.google.com') { |query| query.get('/') } assert_equal '200', response.code assert response.body.include?('Google') end - def test_mock_post_with_request_from_file_as_registered_uri + def _test_mock_post_with_request_from_file_as_registered_uri 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('/', '') } assert_equal "200", response.code @@ -498,21 +498,21 @@ 4.times { assert_equal 'ever_more', Net::HTTP.get(uri) } end - def test_mock_request_using_response_with_transfer_encoding_header_has_valid_transfer_encoding_header + def _test_mock_request_using_response_with_transfer_encoding_header_has_valid_transfer_encoding_header FakeWeb.register_uri(:get, 'http://www.google.com/', :response => fixture_path("google_response_with_transfer_encoding")) response = Net::HTTP.start('www.google.com') { |query| query.get('/') } assert_not_nil response['transfer-encoding'] assert response['transfer-encoding'] == 'chunked' end - def test_mock_request_using_response_without_transfer_encoding_header_does_not_have_a_transfer_encoding_header + def _test_mock_request_using_response_without_transfer_encoding_header_does_not_have_a_transfer_encoding_header FakeWeb.register_uri(:get, 'http://www.google.com/', :response => fixture_path("google_response_without_transfer_encoding")) response = nil response = Net::HTTP.start('www.google.com') { |query| query.get('/') } assert !response.key?('transfer-encoding') end - def test_mock_request_using_response_from_curl_has_original_transfer_encoding_header + def _test_mock_request_using_response_from_curl_has_original_transfer_encoding_header 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('/') } assert_not_nil response['transfer-encoding'] @@ -564,7 +564,7 @@ assert_equal "test example content", response.body end - def test_registering_with_a_response_pointing_to_a_pathname + def _test_registering_with_a_response_pointing_to_a_pathname path = Pathname.new(fixture_path("google_response_without_transfer_encoding")) FakeWeb.register_uri(:get, "http://google.com", :response => path) response = Net::HTTP.start("google.com") { |http| http.get("/") } --- a/test/test_missing_pathname.rb +++ b/test/test_missing_pathname.rb @@ -22,7 +22,7 @@ Net::HTTP.start("example.com") { |http| http.get("/") } end - def test_register_using_response_without_pathname + def _test_register_using_response_without_pathname FakeWeb.register_uri(:get, "http://example.com/", :response => fixture_path("google_response_without_transfer_encoding")) Net::HTTP.start("example.com") { |http| http.get("/") } end debian/patches/series0000644000000000000000000000006612247157014012037 0ustar fix_tests_ruby2.0.patch deactivate_google_tests.patch debian/patches/fix_tests_ruby2.0.patch0000644000000000000000000000245412247157014015137 0ustar From ac856c369445631118f4a51f73793af1ea5c5e1a Mon Sep 17 00:00:00 2001 Description: Update test suite for Ruby 2 Author: Josef Stribny Origin: https://github.com/chrisk/fakeweb/commit/ae0e2d9ce0da577262febed92e44b7a87617b88f.patch Bug: https://github.com/chrisk/fakeweb/pull/37 Reviewed-by: Cédric Boutillier 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)