diff options
author | Andy Delcambre <adelcambre@engineyard.com> | 2010-02-08 23:39:42 -0800 |
---|---|---|
committer | Andy Delcambre <adelcambre@engineyard.com> | 2010-02-09 14:20:04 -0800 |
commit | 6c5a67dc849e7ed4dc1fc05176afcf6ae61ec776 (patch) | |
tree | 0b9e8f0253697efa75b9bf8b1c0e6631c5f65309 /spec | |
parent | b6bee12d9831a82061e6c2f68f21e59a06a3246f (diff) | |
download | bundler-6c5a67dc849e7ed4dc1fc05176afcf6ae61ec776.tar.gz |
Dump full details into Gemfile.lock
* Lock any groups
* Lock :require
* Use these when rehydrating from yml
Diffstat (limited to 'spec')
-rw-r--r-- | spec/runtime/require_spec.rb | 40 |
1 files changed, 36 insertions, 4 deletions
diff --git a/spec/runtime/require_spec.rb b/spec/runtime/require_spec.rb index d96585cb05..d53e5e4cfd 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 |