[DRE-commits] [pry] 04/05: add for autopkgtest-pkg-ruby.

Daisuke Higuchi dai at moszumanska.debian.org
Sun Oct 22 02:17:27 UTC 2017


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

dai pushed a commit to branch master
in repository pry.

commit 4d9e5da200c893cf06854f7e96e953f6b5536d89
Author: HIGUCHI Daisuke (VDR dai) <dai at debian.org>
Date:   Sun Oct 22 11:09:55 2017 +0900

    add for autopkgtest-pkg-ruby.
---
 debian/control                     |  1 -
 debian/tests/control               |  3 ++
 debian/tests/fix_pry_rb_path.patch | 60 ++++++++++++++++++++++++++++++++++++++
 debian/tests/run-test              |  9 ++++++
 4 files changed, 72 insertions(+), 1 deletion(-)

diff --git a/debian/control b/debian/control
index 652dc67..2742ec9 100644
--- a/debian/control
+++ b/debian/control
@@ -14,7 +14,6 @@ Standards-Version: 4.1.1
 Vcs-Git: https://anonscm.debian.org/git/pkg-ruby-extras/pry.git
 Vcs-Browser: https://anonscm.debian.org/cgit/pkg-ruby-extras/pry.git
 Homepage: http://pryrepl.org
-Testsuite: autopkgtest-pkg-ruby
 XS-Ruby-Versions: all
 
 Package: pry
diff --git a/debian/tests/control b/debian/tests/control
new file mode 100644
index 0000000..4ea230c
--- /dev/null
+++ b/debian/tests/control
@@ -0,0 +1,3 @@
+Tests: run-test
+Restrictions: allow-stderr
+Depends: @, quilt, gem2deb-test-runner, ruby-rspec, gist
diff --git a/debian/tests/fix_pry_rb_path.patch b/debian/tests/fix_pry_rb_path.patch
new file mode 100644
index 0000000..f426d64
--- /dev/null
+++ b/debian/tests/fix_pry_rb_path.patch
@@ -0,0 +1,60 @@
+Description: fix pry.rb path for autopkgtests
+Author: HIGUCHI Daisuke (VDR dai) <dai at debian.org>
+Origin: vendor
+Forwarded: not-needed
+Last-Update: 2017-10-22
+
+diff --git a/spec/code_spec.rb b/spec/code_spec.rb
+index 2a6d548..7d70a8e 100644
+--- a/spec/code_spec.rb
++++ b/spec/code_spec.rb
+@@ -3,7 +3,7 @@ require_relative 'helper'
+ describe Pry::Code do
+   describe '.from_file' do
+     specify 'read lines from a file on disk' do
+-      expect(Pry::Code.from_file('lib/pry.rb').length).to be > 0
++      expect(Pry::Code.from_file('/usr/lib/ruby/vendor_ruby/pry.rb').length).to be > 0
+     end
+ 
+     specify 'read lines from Pry\'s line buffer' do
+diff --git a/spec/commands/edit_spec.rb b/spec/commands/edit_spec.rb
+index 24ff632..5146867 100644
+--- a/spec/commands/edit_spec.rb
++++ b/spec/commands/edit_spec.rb
+@@ -42,20 +42,20 @@ describe "edit" do
+     end
+ 
+     it "should invoke Pry.config.editor with absolutified filenames" do
+-      pry_eval 'edit lib/pry.rb'
+-      expect(@file).to eq File.expand_path('lib/pry.rb')
++      pry_eval 'edit /usr/lib/ruby/vendor_ruby/pry.rb'
++      expect(@file).to eq File.expand_path('/usr/lib/ruby/vendor_ruby/pry.rb')
+ 
+       pry_eval "edit #@tf_path"
+       expect(@file).to eq @tf_path
+     end
+ 
+     it "should guess the line number from a colon" do
+-      pry_eval 'edit lib/pry.rb:10'
++      pry_eval 'edit /usr/lib/ruby/vendor_ruby/pry.rb:10'
+       expect(@line).to eq 10
+     end
+ 
+     it "should use the line number from -l" do
+-      pry_eval 'edit -l 10 lib/pry.rb'
++      pry_eval 'edit -l 10 /usr/lib/ruby/vendor_ruby/pry.rb'
+       expect(@line).to eq 10
+     end
+ 
+@@ -152,9 +152,9 @@ describe "edit" do
+       end
+ 
+       it "should pass the editor a reloading arg" do
+-        pry_eval 'edit lib/pry.rb'
++        pry_eval 'edit /usr/lib/ruby/vendor_ruby/pry.rb'
+         expect(@reloading).to eq true
+-        pry_eval 'edit -n lib/pry.rb'
++        pry_eval 'edit -n /usr/lib/ruby/vendor_ruby/pry.rb'
+         expect(@reloading).to eq false
+       end
+     end
diff --git a/debian/tests/run-test b/debian/tests/run-test
new file mode 100644
index 0000000..8f464f8
--- /dev/null
+++ b/debian/tests/run-test
@@ -0,0 +1,9 @@
+#!/bin/sh
+
+set -e
+
+QUILT_PATCHES=debian/patches quilt push -a || true
+patch -p1 < debian/tests/fix_pry_rb_path.patch
+gem2deb-test-runner --check-dependencies --autopkgtest 2>&1
+patch -p1 -R < debian/tests/fix_pry_rb_path.patch
+QUILT_PATCHES=debian/patches quilt pop -a || true

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



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