aboutsummaryrefslogtreecommitdiffstats
path: root/spec/runtime
diff options
context:
space:
mode:
authorAndre Arko <andre@arko.net>2010-03-23 15:37:11 -0700
committerAndre Arko <andre@arko.net>2010-03-23 15:37:11 -0700
commita795d35b497af4ad4fbc9a8a1ab4c01207b3f3fa (patch)
tree6dfad85626e664cbb7625643c2e86fde82769d85 /spec/runtime
parent23e8bcb1d6d4195d2a636678a3bb0e30a1442d21 (diff)
downloadbundler-a795d35b497af4ad4fbc9a8a1ab4c01207b3f3fa.tar.gz
Set GEM_HOME and GEM_PATH correctly when locked
Diffstat (limited to 'spec/runtime')
-rw-r--r--spec/runtime/environment_rb_spec.rb32
1 files changed, 32 insertions, 0 deletions
diff --git a/spec/runtime/environment_rb_spec.rb b/spec/runtime/environment_rb_spec.rb
index 40974420..f18c3be2 100644
--- a/spec/runtime/environment_rb_spec.rb
+++ b/spec/runtime/environment_rb_spec.rb
@@ -17,6 +17,7 @@ describe "environment.rb file" do
it "works with gems from git that don't have gemspecs" do
run <<-R, :lite_runtime => true
+ `open '.bundle/environment.rb'`
require 'no-gemspec'
puts NOGEMSPEC
R
@@ -73,6 +74,37 @@ describe "environment.rb file" do
out.should == "rack is not part of the bundle. Add it to Gemfile."
end
+
+ it "sets GEM_HOME appropriately" do
+ run "puts ENV['GEM_HOME']", :lite_runtime => true
+ out.should == default_bundle_path.to_s
+ end
+
+ it "sets GEM_PATH appropriately" do
+ run "puts Gem.path", :lite_runtime => true
+ out.should == default_bundle_path.to_s
+ end
+ end
+
+ describe "with system gems in the bundle" do
+ before :each do
+ system_gems "rack-1.0.0"
+
+ install_gemfile <<-G
+ source "file://#{gem_repo1}"
+ gem "rack", "1.0.0"
+ gem "activesupport", "2.3.5"
+ G
+
+ bundle :lock
+ end
+
+ it "sets GEM_PATH appropriately" do
+ run "puts Gem.path", :lite_runtime => true
+ paths = out.split("\n")
+ paths.should include(system_gem_path.to_s)
+ paths.should include(default_bundle_path.to_s)
+ end
end
describe "with a gemspec that requires other files" do