diff options
author | Samuel Giddins <segiddins@segiddins.me> | 2017-07-11 12:34:42 -0500 |
---|---|---|
committer | Samuel Giddins <segiddins@segiddins.me> | 2017-07-19 13:10:40 -0500 |
commit | 118e0d9dab903adcc94b982423f6bfd954c59cf4 (patch) | |
tree | 61ba835e05d03d13dea7ec47a6a0a4815a533d03 | |
parent | 88ed4a282d95512803a4c08394ca56ed8701384c (diff) | |
download | bundler-118e0d9dab903adcc94b982423f6bfd954c59cf4.tar.gz |
Fix deployment specs under Bundler 2
-rw-r--r-- | spec/commands/binstubs_spec.rb | 2 | ||||
-rw-r--r-- | spec/install/deploy_spec.rb | 43 |
2 files changed, 23 insertions, 22 deletions
diff --git a/spec/commands/binstubs_spec.rb b/spec/commands/binstubs_spec.rb index d696ace093..89fc3866f7 100644 --- a/spec/commands/binstubs_spec.rb +++ b/spec/commands/binstubs_spec.rb @@ -143,7 +143,7 @@ RSpec.describe "bundle binstubs <gem>" do expect(bundled_app("exec/rackup")).to exist end - it "setting is saved for bundle install" do + it "setting is saved for bundle install", :bundler => "< 2" do install_gemfile <<-G source "file://#{gem_repo1}" gem "rack" diff --git a/spec/install/deploy_spec.rb b/spec/install/deploy_spec.rb index f2c937b7b4..bbcf19b717 100644 --- a/spec/install/deploy_spec.rb +++ b/spec/install/deploy_spec.rb @@ -33,13 +33,12 @@ RSpec.describe "install with --deployment or --frozen" do expect(out).to include("Please choose only one option") expect(exitstatus).to eq(15) if exitstatus end - end - it "works after you try to deploy without a lock" do - bundle "install --deployment" - bundle :install - expect(exitstatus).to eq(0) if exitstatus - expect(the_bundle).to include_gems "rack 1.0" + it "works after you try to deploy without a lock" do + bundle "install --deployment" + bundle! :install + expect(the_bundle).to include_gems "rack 1.0" + end end it "still works if you are not in the app directory and specify --gemfile" do @@ -80,7 +79,7 @@ RSpec.describe "install with --deployment or --frozen" do G bundle! :install - bundle! "install --deployment" + bundle! :install, forgotten_command_line_options([:deployment, :frozen] => true) end it "works when there are credentials in the source URL" do @@ -110,14 +109,16 @@ RSpec.describe "install with --deployment or --frozen" do bundle "install" end - it "works with the --deployment flag if you didn't change anything" do - bundle "install --deployment" - expect(exitstatus).to eq(0) if exitstatus + it "works with the --deployment flag if you didn't change anything", :bundler => "< 2" do + bundle! "install --deployment" end - it "works with the --frozen flag if you didn't change anything" do - bundle "install --frozen" - expect(exitstatus).to eq(0) if exitstatus + it "works with the --frozen flag if you didn't change anything", :bundler => "< 2" do + bundle! "install --frozen" + end + + it "works with BUNDLE_FROZEN if you didn't change anything" do + bundle! :install, :env => { "BUNDLE_FROZEN" => "true" } end it "explodes with the --deployment flag if you make a change and don't check in the lockfile" do @@ -127,7 +128,7 @@ RSpec.describe "install with --deployment or --frozen" do gem "rack-obama" G - bundle "install --deployment" + bundle :install, forgotten_command_line_options([:deployment, :frozen] => true) expect(out).to include("deployment mode") expect(out).to include("You have added to the Gemfile") expect(out).to include("* rack-obama") @@ -160,7 +161,7 @@ RSpec.describe "install with --deployment or --frozen" do expect(the_bundle).to include_gems "path_gem 1.0" FileUtils.rm_r lib_path("path_gem-1.0") - bundle :install, :path => ".bundle", :deployment => true + bundle :install, forgotten_command_line_options(:path => ".bundle", [:deployment, :frozen] => true) expect(out).to include("The path `#{lib_path("path_gem-1.0")}` does not exist.") end @@ -218,7 +219,7 @@ RSpec.describe "install with --deployment or --frozen" do gem "rack-obama", "1.1" G - bundle "install --frozen" + bundle :install, forgotten_command_line_options(:frozen => true) expect(out).to include("deployment mode") expect(out).to include("You have added to the Gemfile") expect(out).to include("* rack-obama (= 1.1)") @@ -232,7 +233,7 @@ RSpec.describe "install with --deployment or --frozen" do gem "activesupport" G - bundle "install --deployment" + bundle :install, forgotten_command_line_options([:deployment, :frozen] => true) expect(out).to include("deployment mode") expect(out).to include("You have added to the Gemfile:\n* activesupport\n\n") expect(out).to include("You have deleted from the Gemfile:\n* rack") @@ -245,7 +246,7 @@ RSpec.describe "install with --deployment or --frozen" do gem "rack", :git => "git://hubz.com" G - bundle "install --deployment" + bundle :install, forgotten_command_line_options([:deployment, :frozen] => true) expect(out).to include("deployment mode") expect(out).to include("You have added to the Gemfile:\n* source: git://hubz.com (at master)") expect(out).not_to include("You have changed in the Gemfile") @@ -264,7 +265,7 @@ RSpec.describe "install with --deployment or --frozen" do gem "rack" G - bundle "install --deployment" + bundle :install, forgotten_command_line_options([:deployment, :frozen] => true) expect(out).to include("deployment mode") expect(out).to include("You have deleted from the Gemfile:\n* source: #{lib_path("rack-1.0")} (at master@#{revision_for(lib_path("rack-1.0"))[0..6]}") expect(out).not_to include("You have added to the Gemfile") @@ -287,7 +288,7 @@ RSpec.describe "install with --deployment or --frozen" do gem "foo", :git => "#{lib_path("rack")}" G - bundle "install --deployment" + bundle :install, forgotten_command_line_options([:deployment, :frozen] => true) expect(out).to include("deployment mode") expect(out).to include("You have changed in the Gemfile:\n* rack from `no specified source` to `#{lib_path("rack")} (at master@#{revision_for(lib_path("rack"))[0..6]})`") expect(out).not_to include("You have added to the Gemfile") @@ -335,7 +336,7 @@ You have deleted from the Gemfile: expect(out).to include("Updating files in vendor/cache") simulate_new_machine - bundle! "install --deployment --verbose" + bundle! "install --verbose", forgotten_command_line_options([:deployment, :frozen] => true) expect(out).not_to include("You are trying to install in deployment mode after changing your Gemfile") expect(out).not_to include("You have added to the Gemfile") expect(out).not_to include("You have deleted from the Gemfile") |