[DRE-commits] [chef] 01/01: debian/ruby-tests.rake: set $HOME to a temporary dir

Antonio Terceiro terceiro at moszumanska.debian.org
Sun Jun 5 16:11:09 UTC 2016


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

terceiro pushed a commit to branch master
in repository chef.

commit b0606c43f112d8acb281da46c7a536cc038e4ab1
Author: Antonio Terceiro <terceiro at debian.org>
Date:   Sun Jun 5 12:36:00 2016 -0300

    debian/ruby-tests.rake: set $HOME to a temporary dir
---
 debian/changelog       | 2 ++
 debian/ruby-tests.rake | 9 +++++++++
 2 files changed, 11 insertions(+)

diff --git a/debian/changelog b/debian/changelog
index 6b2d900..98c0cb5 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -12,6 +12,8 @@ chef (12.10.24-1) UNRELEASED; urgency=medium
     are release in lockstep and developed together in the same git repository
     (but released separately to rubygems).
   * debian/rules: also install files moved to lib-backcompat/ by upstream
+  * debian/ruby-tests.rake: set $HOME to a temporary dir as part of code uses
+    $HOME during the tests
 
  -- Antonio Terceiro <terceiro at debian.org>  Sun, 05 Jun 2016 10:49:39 -0300
 
diff --git a/debian/ruby-tests.rake b/debian/ruby-tests.rake
index 8bb51d1..506f8fd 100644
--- a/debian/ruby-tests.rake
+++ b/debian/ruby-tests.rake
@@ -1,3 +1,6 @@
+require 'fileutils'
+require 'tmpdir'
+
 require 'gem2deb/rake/spectask'
 
 blacklist_file = File.join(File.dirname(__FILE__), 'ruby-tests.blacklist')
@@ -6,6 +9,12 @@ blacklist.each do |f|
   puts "Blacklisted test file: #{f}"
 end
 
+tmpdir = Dir.mktmpdir
+ENV['HOME'] = tmpdir
+at_exit do
+  FileUtils.rm_rf tmpdir
+end
+
 Gem2Deb::Rake::RSpecTask.new do |spec|
   spec.pattern = Dir['spec/**/*_spec.rb'].reject { |f| blacklist.include?(f) }
 end

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



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