summaryrefslogtreecommitdiff
path: root/spec/support
diff options
context:
space:
mode:
authorTerence Lee <hone02@gmail.com>2011-11-17 23:25:07 -0800
committerTerence Lee <hone02@gmail.com>2011-11-18 13:07:28 -0800
commit63e27f08bef92fed1881e69a630e776d35dc6d4e (patch)
treef7a7d1ad41e50c05e8bae67be25d5e306bb515fb /spec/support
parentc6cd06ba9223b283a193649825cb6d073f1a2fa3 (diff)
downloadbundler-63e27f08bef92fed1881e69a630e776d35dc6d4e.tar.gz
failing test for #1500
Diffstat (limited to 'spec/support')
-rw-r--r--spec/support/helpers.rb24
1 files changed, 24 insertions, 0 deletions
diff --git a/spec/support/helpers.rb b/spec/support/helpers.rb
index 33f38fde95..b65612c319 100644
--- a/spec/support/helpers.rb
+++ b/spec/support/helpers.rb
@@ -232,6 +232,30 @@ module Spec
end
end
+ def realworld_system_gems(*gems)
+ gems = gems.flatten
+
+ FileUtils.rm_rf(system_gem_path)
+ FileUtils.mkdir_p(system_gem_path)
+
+ Gem.clear_paths
+
+ gem_home, gem_path, path = ENV['GEM_HOME'], ENV['GEM_PATH'], ENV['PATH']
+ ENV['GEM_HOME'], ENV['GEM_PATH'] = system_gem_path.to_s, system_gem_path.to_s
+
+ gems.each do |gem|
+ gem_command :install, "--no-rdoc --no-ri #{gem}"
+ end
+ if block_given?
+ begin
+ yield
+ ensure
+ ENV['GEM_HOME'], ENV['GEM_PATH'] = gem_home, gem_path
+ ENV['PATH'] = path
+ end
+ end
+ end
+
def cache_gems(*gems)
gems = gems.flatten