aboutsummaryrefslogtreecommitdiffstats
path: root/spec/runtime/require_spec.rb
diff options
context:
space:
mode:
authorAndy Delcambre <adelcambre@engineyard.com>2010-02-08 23:39:42 -0800
committerAndy Delcambre <adelcambre@engineyard.com>2010-02-09 14:20:04 -0800
commit6c5a67dc849e7ed4dc1fc05176afcf6ae61ec776 (patch)
tree0b9e8f0253697efa75b9bf8b1c0e6631c5f65309 /spec/runtime/require_spec.rb
parentb6bee12d9831a82061e6c2f68f21e59a06a3246f (diff)
downloadbundler-6c5a67dc849e7ed4dc1fc05176afcf6ae61ec776.tar.gz
Dump full details into Gemfile.lock
* Lock any groups * Lock :require * Use these when rehydrating from yml
Diffstat (limited to 'spec/runtime/require_spec.rb')
-rw-r--r--spec/runtime/require_spec.rb40
1 files changed, 36 insertions, 4 deletions
diff --git a/spec/runtime/require_spec.rb b/spec/runtime/require_spec.rb
index d96585cb..d53e5e4c 100644
--- a/spec/runtime/require_spec.rb
+++ b/spec/runtime/require_spec.rb
@@ -45,15 +45,47 @@ describe "Bundler.require" do
it "requires the locked gems" do
bundle :lock
- env = bundled_app(".bundle/environment.rb")
- out = ruby("require '#{env}'; Bundler.setup; Bundler.require")
+ out = ruby("require 'bundler'; Bundler.setup; Bundler.require")
+ puts out
out.should == "two"
- out = ruby("require '#{env}'; Bundler.setup(:bar); Bundler.require(:bar)")
+ out = ruby("require 'bundler'; Bundler.setup(:bar); Bundler.require(:bar)")
out.should == "baz\nqux"
- out = ruby("require '#{env}'; Bundler.setup(:default, :bar); Bundler.require(:default, :bar)")
+ out = ruby("require 'bundler'; Bundler.setup(:default, :bar); Bundler.require(:default, :bar)")
out.should == "two\nbaz\nqux"
end
+
+ describe "requiring the environment directly" do
+ it "requires the locked gems" do
+ bundle :lock
+ env = bundled_app(".bundle/environment.rb")
+
+ out = ruby("require '#{env}'; Bundler.setup; Bundler.require")
+ out.should == "two"
+
+ out = ruby("require '#{env}'; Bundler.setup(:bar); Bundler.require(:bar)")
+ out.should == "baz\nqux"
+
+ out = ruby("require '#{env}'; Bundler.setup(:default, :bar); Bundler.require(:default, :bar)")
+ out.should == "two\nbaz\nqux"
+ end
+ end
+
+ describe "using bundle exec" do
+ it "requires the locked gems" do
+ bundle :lock
+
+ bundle "exec ruby -e 'Bundler.require'"
+ out.should == "two"
+
+ bundle "exec ruby -e 'Bundler.require(:bar)'"
+ out.should == "baz\nqux"
+
+ bundle "exec ruby -e 'Bundler.require(:default, :bar)'"
+ out.should == "two\nbaz\nqux"
+ end
+ end
+
end