Skip to content

Commit

Permalink
Bundler.with_clean_env
Browse files Browse the repository at this point in the history
  • Loading branch information
stewart committed Sep 10, 2013
1 parent 8be34fc commit 261b21c
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
2 changes: 1 addition & 1 deletion features/pull.feature
Expand Up @@ -10,4 +10,4 @@ Feature: Pull
Given there is a wiki with Cucumber features defined
And there are local features
When I pull features
Then the local features should match the wiki
Then the local features should match the wiki
6 changes: 5 additions & 1 deletion features/support/env.rb
Expand Up @@ -44,7 +44,11 @@
abort "Failed to clone demo repo to #{@repo_with_features}." if $? != 0

puts "Installing gems for demo repo."
Bundler.with_clean_env do
if defined?(Bundler)
Bundler.with_clean_env do
system "bundle install --path vendor/bundle &> /dev/null"
end
else
system "bundle install --path vendor/bundle &> /dev/null"
end
abort "Failed to install gems for demo repo #{@repo_with_features}" if $? != 0
Expand Down
6 changes: 5 additions & 1 deletion lib/gitnesse/cli/task/run.rb
Expand Up @@ -68,7 +68,11 @@ def remove_hooks
def run_features
puts " Running cucumber."
puts ' -------------------', ''
system "cucumber #{@config.features_dir}"
if defined?(Bundler)
Bundler.with_clean_env { system "cucumber #{@config.features_dir}" }
else
system "cucumber #{@config.features_dir}"
end
puts ' -------------------', ''
end

Expand Down

0 comments on commit 261b21c

Please sign in to comment.