summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVít Ondruch <vondruch@redhat.com>2014-12-09 11:52:01 +0100
committerVít Ondruch <vondruch@redhat.com>2014-12-09 11:52:01 +0100
commit8b90945de0f27e6f9c84edeab10ba137bd7d0b03 (patch)
tree411d4f49da7381fb94554fcf12437fb6bce8b1be
parenteba61220ed79d899fa24f8d9bb941dbc9da9d92c (diff)
downloadbundler-8b90945de0f27e6f9c84edeab10ba137bd7d0b03.tar.gz
Test cleanup of $LOAD_PATH.
-rw-r--r--spec/runtime/setup_spec.rb30
1 files changed, 30 insertions, 0 deletions
diff --git a/spec/runtime/setup_spec.rb b/spec/runtime/setup_spec.rb
index 02ce0de369..6688b84282 100644
--- a/spec/runtime/setup_spec.rb
+++ b/spec/runtime/setup_spec.rb
@@ -628,6 +628,36 @@ describe "Bundler.setup" do
expect(out).to eq("yay")
end
+ it "should clean $LOAD_PATH properly" do
+ gem_name = 'very_simple_binary'
+ full_gem_name = gem_name + '-1.0'
+ ext_dir = File.join(tmp "extenstions", full_gem_name)
+
+ install_gem full_gem_name
+
+ install_gemfile <<-G
+ source "file://#{gem_repo1}"
+ G
+
+ ruby <<-R
+ if Gem::Specification.method_defined? :extension_dir
+ s = Gem::Specification.find_by_name '#{gem_name}'
+ s.extension_dir = '#{ext_dir}'
+ end
+
+ require 'bundler'
+ gem '#{gem_name}'
+
+ puts $LOAD_PATH.count {|path| path =~ /#{gem_name}/} >= 2
+
+ Bundler.setup
+
+ puts $LOAD_PATH.count {|path| path =~ /#{gem_name}/} == 0
+ R
+
+ expect(out).to eq("true\ntrue")
+ end
+
it "stubs out Gem.refresh so it does not reveal system gems" do
system_gems "rack-1.0.0"