diff options
Diffstat (limited to 'spec/support/helpers.rb')
-rw-r--r-- | spec/support/helpers.rb | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/spec/support/helpers.rb b/spec/support/helpers.rb index cb09ecf834..a3a4b16aae 100644 --- a/spec/support/helpers.rb +++ b/spec/support/helpers.rb @@ -74,7 +74,6 @@ module Spec end.join cmd = "#{env} #{sudo} #{Gem.ruby} -I#{lib} #{requires_str} #{bundle_bin} #{cmd}#{args}" - if exitstatus sys_status(cmd) else @@ -83,7 +82,7 @@ module Spec end def bundle_ruby(options = {}) - expect_err = options.delete(:expect_err) + expect_err = options.delete(:expect_err) exitstatus = options.delete(:exitstatus) options["no-color"] = true unless options.key?("no-color") @@ -218,6 +217,14 @@ module Spec ENV['GEM_HOME'], ENV['GEM_PATH'] = gem_home, gem_path end + def with_path_as(path) + old_path = ENV['PATH'] + ENV['PATH'] = "#{path}:#{ENV['PATH']}" + yield + ensure + ENV['PATH'] = old_path + end + def break_git! FileUtils.mkdir_p(tmp("broken_path")) File.open(tmp("broken_path/git"), "w", 0755) do |f| |