From a23fe57fe87bd4eac5e16ec094f341a3bcf46a8d Mon Sep 17 00:00:00 2001 From: Andrew Mutz Date: Fri, 14 Dec 2012 17:12:22 -0800 Subject: [PATCH] Fixing issue where bundler would get confused during multi-app selenium --- Rakefile | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/Rakefile b/Rakefile index 91657fb1..dda28bff 100644 --- a/Rakefile +++ b/Rakefile @@ -35,7 +35,9 @@ end def run_test_in(directory, *tasks) env = "TEST=../../#{ENV['TEST']} " if ENV['TEST'] puts '', directory, '' - system("cd #{directory} && #{env} bundle exec rake #{tasks.join(' ')}") + with_pruned_env('BUNDLE_GEMFILE') do + system("cd #{directory} && #{env} bundle exec rake #{tasks.join(' ')}") + end end def for_each_directory_of(path, &block) @@ -45,5 +47,11 @@ def for_each_directory_of(path, &block) end end +def with_pruned_env(key_to_withhold, &block) + withholding = ENV.delete(key_to_withhold) + tap{ |r| r = yield; ENV[key_to_withhold] = withholding } +end + + desc 'Default: run the unit and integration tests.' task :default => ['test:integration:units', 'test:integration:selenium']