[DRE-commits] [ruby-dotenv] 06/10: fix test suite under the non-default Ruby interpreter.

Antonio Terceiro terceiro at moszumanska.debian.org
Thu Sep 10 23:08:11 UTC 2015


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

terceiro pushed a commit to branch master
in repository ruby-dotenv.

commit 3f1e1d2702b6620b1a661465eab753714ea37c17
Author: Antonio Terceiro <terceiro at debian.org>
Date:   Thu Sep 10 19:34:41 2015 -0300

    fix test suite under the non-default Ruby interpreter.
---
 debian/changelog                                   |  2 ++
 ...ser_spec-don-t-assume-being-run-with-ruby.patch | 37 ++++++++++++++++++++++
 debian/patches/series                              |  1 +
 3 files changed, 40 insertions(+)

diff --git a/debian/changelog b/debian/changelog
index def8a4a..d7c11ed 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -4,6 +4,8 @@ ruby-dotenv (2.0.2-1) UNRELEASED; urgency=medium
   * New upstream release
   * debian/watch: point at github
   * Refresh packaging with a new dh-make-ruby run
+  * 0001-parser_spec-don-t-assume-being-run-with-ruby.patch: fix test suite
+    when running under the non-default Ruby interpreter.
 
  -- Antonio Terceiro <terceiro at debian.org>  Thu, 10 Sep 2015 19:13:28 -0300
 
diff --git a/debian/patches/0001-parser_spec-don-t-assume-being-run-with-ruby.patch b/debian/patches/0001-parser_spec-don-t-assume-being-run-with-ruby.patch
new file mode 100644
index 0000000..d79cd10
--- /dev/null
+++ b/debian/patches/0001-parser_spec-don-t-assume-being-run-with-ruby.patch
@@ -0,0 +1,37 @@
+From 8032f8881808084381451b75e9cf65a6974e9b0e Mon Sep 17 00:00:00 2001
+From: Antonio Terceiro <terceiro at softwarelivre.org>
+Date: Thu, 10 Sep 2015 19:28:57 -0300
+Subject: [PATCH] parser_spec: don't assume being run with `ruby`
+
+On Debian unstable there are two Ruby interpreters available during
+transitions, and for QA purposes we always run tests during build for
+all Ruby versions. When running under the one that is not the default,
+the output of `ruby -v` will never match RUBY_DESCRIPTION.
+---
+ spec/dotenv/parser_spec.rb | 6 ++++--
+ 1 file changed, 4 insertions(+), 2 deletions(-)
+
+diff --git a/spec/dotenv/parser_spec.rb b/spec/dotenv/parser_spec.rb
+index e0345fb..111cfe2 100644
+--- a/spec/dotenv/parser_spec.rb
++++ b/spec/dotenv/parser_spec.rb
+@@ -125,12 +125,14 @@ export OH_NO_NOT_SET')
+   end
+ 
+   if RUBY_VERSION > "1.8.7"
++    ruby = RbConfig::CONFIG['RUBY_INSTALL_NAME']
++
+     it "parses shell commands interpolated in $()" do
+-      expect(env("ruby_v=$(ruby -v)")).to eql("ruby_v" => RUBY_DESCRIPTION)
++      expect(env("ruby_v=$(#{ruby} -v)")).to eql("ruby_v" => RUBY_DESCRIPTION)
+     end
+ 
+     it "allows balanced parentheses within interpolated shell commands" do
+-      expect(env('ruby_v=$(echo "$(echo "$(echo "$(ruby -v)")")")'))
++      expect(env('ruby_v=$(echo "$(echo "$(echo "$(' + ruby + ' -v)")")")'))
+         .to eql("ruby_v" => RUBY_DESCRIPTION)
+     end
+ 
+-- 
+2.5.1
+
diff --git a/debian/patches/series b/debian/patches/series
new file mode 100644
index 0000000..9eca658
--- /dev/null
+++ b/debian/patches/series
@@ -0,0 +1 @@
+0001-parser_spec-don-t-assume-being-run-with-ruby.patch

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



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