[DRE-commits] [gem2deb] 01/05: add an option to Gem2Deb::DhMakeRuby to activate wnpp_check

Cédric Boutillier boutil at moszumanska.debian.org
Wed Jul 30 14:17:28 UTC 2014


This is an automated email from the git hooks/post-receive script.

boutil pushed a commit to branch master
in repository gem2deb.

commit e38486a476980ec407ee78fe1d93d557dc672ada
Author: Cédric Boutillier <boutil at debian.org>
Date:   Wed Jul 30 14:39:09 2014 +0200

    add an option to Gem2Deb::DhMakeRuby to activate wnpp_check
    
    wnpp_check should be disabled by default in the Gem2Deb::DhMakeRuby
    class to be able to run tests without network access in a reasonable
    time (wnpp-check takes some time to die if no network access).
---
 lib/gem2deb/dh_make_ruby.rb    | 4 +++-
 test/unit/dh_make_ruby_test.rb | 4 ++--
 2 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/lib/gem2deb/dh_make_ruby.rb b/lib/gem2deb/dh_make_ruby.rb
index f5a1a48..2940487 100644
--- a/lib/gem2deb/dh_make_ruby.rb
+++ b/lib/gem2deb/dh_make_ruby.rb
@@ -55,6 +55,8 @@ module Gem2Deb
 
     attr_accessor :input_directory
 
+    attr_accessor :do_wnpp_check
+
     def initialize(input, options = {})
       initialize_from_options(options)
       if File.directory?(input)
@@ -192,7 +194,7 @@ module Gem2Deb
     end
 
     def itp_bug
-      if wnpp_check.length > 0
+      if do_wnpp_check && wnpp_check.length > 0
         wnpp_check.split(" ")[2].chomp(")")
       else
         "#nnnn"
diff --git a/test/unit/dh_make_ruby_test.rb b/test/unit/dh_make_ruby_test.rb
index c946d48..a20d4a5 100644
--- a/test/unit/dh_make_ruby_test.rb
+++ b/test/unit/dh_make_ruby_test.rb
@@ -31,13 +31,13 @@ class DhMakeRubyTest < Gem2DebTestCase
   end
 
   should 'use #nnnn if no ITP bug exists' do
-      @dh_make_ruby = Gem2Deb::DhMakeRuby.new('ruby_foo-1.2.3.tar.gz')
+      @dh_make_ruby = Gem2Deb::DhMakeRuby.new('ruby_foo-1.2.3.tar.gz', :do_wnpp_check => true)
       @dh_make_ruby.stubs(:wnpp_check).returns('')
       assert_equal @dh_make_ruby.itp_bug, '#nnnn'
   end
 
   should 'use ITP bug if it exists' do
-      @dh_make_ruby = Gem2Deb::DhMakeRuby.new('ruby_foo-1.2.3.tar.gz')
+      @dh_make_ruby = Gem2Deb::DhMakeRuby.new('ruby_foo-1.2.3.tar.gz', :do_wnpp_check => true)
       @dh_make_ruby.stubs(:wnpp_check).returns('(ITP - #42) http://bugs.debian.org/42 ruby-foo')
       assert_equal @dh_make_ruby.itp_bug, '#42'
   end

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-ruby-extras/gem2deb.git



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