From 10c8e11db6f363619f184f471fe6928583715137 Mon Sep 17 00:00:00 2001 From: Carl Lerche Date: Fri, 6 Aug 2010 15:53:26 -0700 Subject: Have bundler remember that the bundle is frozen and ignore changes to the Gemfile during runtime --- spec/install/deploy_spec.rb | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) (limited to 'spec/install/deploy_spec.rb') diff --git a/spec/install/deploy_spec.rb b/spec/install/deploy_spec.rb index 792fb36982..1d03c91aca 100644 --- a/spec/install/deploy_spec.rb +++ b/spec/install/deploy_spec.rb @@ -48,6 +48,22 @@ describe "install with --deployment or --frozen" do out.should_not include("You have changed in the Gemfile") end + it "can have --frozen set via an environment variable" do + gemfile <<-G + source "file://#{gem_repo1}" + gem "rack" + gem "rack-obama" + G + + ENV['BUNDLE_FROZEN'] = '1' + bundle "install" + out.should include("You have modified your Gemfile") + out.should include("You have added to the Gemfile") + out.should include("* rack-obama") + out.should_not include("You have deleted from the Gemfile") + out.should_not include("You have changed in the Gemfile") + end + it "explodes with the --frozen flag if you make a change and don't check in the lockfile" do gemfile <<-G source "file://#{gem_repo1}" @@ -130,5 +146,17 @@ describe "install with --deployment or --frozen" do out.should_not include("You have added to the Gemfile") out.should_not include("You have deleted from the Gemfile") end + + it "remembers that the bundle is frozen at runtime" do + bundle "install --deployment" + + gemfile <<-G + source "file://#{gem_repo1}" + gem "rack", "1.0.0" + gem "rack-obama" + G + + should_be_installed "rack 1.0.0" + end end end -- cgit v1.2.1