[DRE-commits] [foodcritic] 09/12: Avoid depending on the lib directory in tests, for autopkgtests.

Stefano Rivera stefano at rivera.za.net
Sun Jan 3 18:13:07 UTC 2016


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

stefanor pushed a commit to branch master
in repository foodcritic.

commit f59b62c45336e0651db469b608d98f0b40255c86
Author: Stefano Rivera <stefanor at debian.org>
Date:   Sun Jan 3 19:49:10 2016 +0200

    Avoid depending on the lib directory in tests, for autopkgtests.
---
 debian/changelog                   |  1 +
 debian/patches/autopkgtests-no-lib | 53 ++++++++++++++++++++++++++++++++++++++
 debian/patches/series              |  1 +
 3 files changed, 55 insertions(+)

diff --git a/debian/changelog b/debian/changelog
index 668ae51..ba5a038 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -9,6 +9,7 @@ foodcritic (5.0.0-1) UNRELEASED; urgency=medium
   * Use https in the watch file.
   * Use an absolute require in the spec file, so the autopkgtest can run
     against the system install.
+  * Avoid depending on the lib directory in tests, for autopkgtests.
 
  -- Stefano Rivera <stefanor at debian.org>  Sun, 03 Jan 2016 18:01:56 +0200
 
diff --git a/debian/patches/autopkgtests-no-lib b/debian/patches/autopkgtests-no-lib
new file mode 100644
index 0000000..1789140
--- /dev/null
+++ b/debian/patches/autopkgtests-no-lib
@@ -0,0 +1,53 @@
+Description: avoid the lib directory in autopkgtests
+ The autodep8 ruby tests remove the lib directory, to use the installed library.
+Author: Stefano Rivera <stefanor at debian.org>
+Forwarded: not-needed
+
+--- a/spec/foodcritic/command_line_spec.rb
++++ b/spec/foodcritic/command_line_spec.rb
+@@ -42,23 +42,23 @@
+     end
+ 
+     it "returns true if the specified directory exists" do
+-      assert FoodCritic::CommandLine.new(["lib"]).valid_paths?
++      assert FoodCritic::CommandLine.new(["spec"]).valid_paths?
+     end
+ 
+     it "returns false if the specified directory does not exist" do
+-      refute FoodCritic::CommandLine.new(["lib2"]).valid_paths?
++      refute FoodCritic::CommandLine.new(["spec2"]).valid_paths?
+     end
+ 
+     it "returns true if the specified file exists" do
+-      assert FoodCritic::CommandLine.new(["lib/foodcritic.rb"]).valid_paths?
++      assert FoodCritic::CommandLine.new(["spec/spec_helper.rb"]).valid_paths?
+     end
+ 
+     it "returns true if both specified paths exist" do
+-      assert FoodCritic::CommandLine.new(["lib", "lib/foodcritic.rb"]).valid_paths?
++      assert FoodCritic::CommandLine.new(["spec", "spec/spec_helper.rb"]).valid_paths?
+     end
+ 
+     it "returns false if any on the specified paths do not exist" do
+-      refute FoodCritic::CommandLine.new(["lib", "lib2"]).valid_paths?
++      refute FoodCritic::CommandLine.new(["spec", "spec2"]).valid_paths?
+     end
+   end
+ 
+--- a/spec/foodcritic/linter_spec.rb
++++ b/spec/foodcritic/linter_spec.rb
+@@ -54,6 +54,7 @@
+   end
+ 
+ 
++ if !ENV.has_key? 'ADTTMP'
+   describe "#load_files!" do
+     let(:default_rules_file) do
+       File.expand_path(File.join(File.dirname(__FILE__), '../../lib/foodcritic/rules.rb'))
+@@ -96,5 +97,6 @@
+     end
+ 
+   end
++ end
+ 
+ end
diff --git a/debian/patches/series b/debian/patches/series
index ebd4bae..26b80e8 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -2,3 +2,4 @@ no-rubygems
 system-install-layout
 no-rufus-lru
 dont-load-minitest-autorun-in-cucumber-tests.patch
+autopkgtests-no-lib

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



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