diff options
author | Andre Arko <andre@arko.net> | 2012-10-02 18:15:43 -0700 |
---|---|---|
committer | Andre Arko <andre@arko.net> | 2012-10-02 18:15:43 -0700 |
commit | 0d2f5f548602b3c2ef94d88fcdb50e5bc60d8b3f (patch) | |
tree | d95007a42fb8eb2b2ffb4d1a1addea7bace8643f /spec/integration | |
parent | 31c75113b63a3276ab60a2acacbf1d5b2b74226b (diff) | |
download | bundler-0d2f5f548602b3c2ef94d88fcdb50e5bc60d8b3f.tar.gz |
ignore frozen while injecting
Diffstat (limited to 'spec/integration')
-rw-r--r-- | spec/integration/inject.rb | 62 |
1 files changed, 38 insertions, 24 deletions
diff --git a/spec/integration/inject.rb b/spec/integration/inject.rb index 6014b0fe..8c20ef70 100644 --- a/spec/integration/inject.rb +++ b/spec/integration/inject.rb @@ -1,12 +1,24 @@ require 'spec_helper' describe "bundle inject" do + before :each do + gemfile <<-G + source "file://#{gem_repo1}" + gem "rack" + G + end + + context "without a lockfile" do + it "locks with the injected gems" do + bundled_app("Gemfile.lock").should_not exist + bundle "inject 'rack-obama' '> 0'" + bundled_app("Gemfile.lock").read.should match(/rack-obama/) + end + end + context "with a lockfile" do - before :each do - install_gemfile <<-G - source "file://#{gem_repo1}" - gem "rack" - G + before do + bundle "install" end it "adds the injected gems to the gemfile" do @@ -22,32 +34,34 @@ describe "bundle inject" do end end - context "without a lockfile" do - before :each do - gemfile <<-G - source "file://#{gem_repo1}" - gem "rack" - G + context "with injected gems already in the Gemfile" do + it "doesn't add existing gems" do + bundle "inject 'rack' '> 0'" + out.should match(/cannot specify the same gem twice/i) + end + end + + context "when frozen" do + before do + bundle "install" + bundle "config --local frozen 1" end - it "locks with the injected gems" do - bundled_app("Gemfile.lock").should_not exist + it "injects anyway" do bundle "inject 'rack-obama' '> 0'" - bundled_app("Gemfile.lock").read.should match(/rack-obama/) + bundled_app("Gemfile").read.should match(/rack-obama/) end - end - context "injected gems already in the Gemfile" do - before :each do - gemfile <<-G - source "file://#{gem_repo1}" - gem "rack" - G + it "locks with the injected gems" do + bundled_app("Gemfile.lock").read.should_not match(/rack-obama/) + bundle "inject 'rack-obama' '> 0'" + bundled_app("Gemfile.lock").read.should match(/rack-obama/) end - it "doesn't add existing gems" do - bundle "inject 'rack' '> 0'" - out.should match(/cannot specify the same gem twice/i) + it "restores frozen afterwards" do + bundle "inject 'rack-obama' '> 0'" + config = YAML.load(bundled_app(".bundle/config").read) + config["BUNDLE_FROZEN"].should == "1" end end end
\ No newline at end of file |