diff options
author | David RodrÃguez <deivid.rodriguez@riseup.net> | 2019-08-26 11:34:59 +0200 |
---|---|---|
committer | David RodrÃguez <deivid.rodriguez@riseup.net> | 2020-01-12 13:58:00 +0100 |
commit | 2c26c8c2f3b2d8c68c2170ba06193b1d13847738 (patch) | |
tree | d616397cf09f978705fdfc37d1950407431065e5 /spec | |
parent | 971d39b32d3ec8bfcdc951061c88e364f864423e (diff) | |
download | bundler-2c26c8c2f3b2d8c68c2170ba06193b1d13847738.tar.gz |
Extract `bundled_app_lock` path helper
Diffstat (limited to 'spec')
-rw-r--r-- | spec/bundler/definition_spec.rb | 6 | ||||
-rw-r--r-- | spec/bundler/env_spec.rb | 2 | ||||
-rw-r--r-- | spec/cache/gems_spec.rb | 6 | ||||
-rw-r--r-- | spec/commands/binstubs_spec.rb | 2 | ||||
-rw-r--r-- | spec/commands/check_spec.rb | 6 | ||||
-rw-r--r-- | spec/commands/clean_spec.rb | 4 | ||||
-rw-r--r-- | spec/commands/info_spec.rb | 2 | ||||
-rw-r--r-- | spec/commands/inject_spec.rb | 14 | ||||
-rw-r--r-- | spec/commands/install_spec.rb | 12 | ||||
-rw-r--r-- | spec/commands/show_spec.rb | 4 | ||||
-rw-r--r-- | spec/commands/update_spec.rb | 4 | ||||
-rw-r--r-- | spec/install/gemfile/git_spec.rb | 14 | ||||
-rw-r--r-- | spec/install/gems/flex_spec.rb | 2 | ||||
-rw-r--r-- | spec/install/gems/win32_spec.rb | 2 | ||||
-rw-r--r-- | spec/lock/lockfile_spec.rb | 28 | ||||
-rw-r--r-- | spec/other/platform_spec.rb | 38 | ||||
-rw-r--r-- | spec/runtime/setup_spec.rb | 14 | ||||
-rw-r--r-- | spec/support/matchers.rb | 2 | ||||
-rw-r--r-- | spec/support/path.rb | 4 |
19 files changed, 85 insertions, 81 deletions
diff --git a/spec/bundler/definition_spec.rb b/spec/bundler/definition_spec.rb index 1f4c1a0807..ad6d4e433e 100644 --- a/spec/bundler/definition_spec.rb +++ b/spec/bundler/definition_spec.rb @@ -213,7 +213,7 @@ RSpec.describe Bundler::Definition do end it "should get a locked specs list when updating all" do - definition = Bundler::Definition.new(bundled_app("Gemfile.lock"), [], Bundler::SourceList.new, true) + definition = Bundler::Definition.new(bundled_app_lock, [], Bundler::SourceList.new, true) locked_specs = definition.gem_version_promoter.locked_specs expect(locked_specs.to_a.map(&:name)).to eq ["foo"] expect(definition.instance_variable_get("@locked_specs").empty?).to eq true @@ -275,7 +275,7 @@ RSpec.describe Bundler::Definition do Bundler::Dependency.new("shared_owner_b", ">= 0")] unlock_hash_for_bundle_install = {} definition = Bundler::Definition.new( - bundled_app("Gemfile.lock"), + bundled_app_lock, updated_deps_in_gemfile, source_list, unlock_hash_for_bundle_install @@ -289,7 +289,7 @@ RSpec.describe Bundler::Definition do Bundler::Dependency.new("shared_owner_a", ">= 0"), Bundler::Dependency.new("shared_owner_b", ">= 0")] definition = Bundler::Definition.new( - bundled_app("Gemfile.lock"), + bundled_app_lock, updated_deps_in_gemfile, source_list, :gems => ["shared_owner_a"], :lock_shared_dependencies => true diff --git a/spec/bundler/env_spec.rb b/spec/bundler/env_spec.rb index 5e588a6042..aefedebf13 100644 --- a/spec/bundler/env_spec.rb +++ b/spec/bundler/env_spec.rb @@ -177,7 +177,7 @@ RSpec.describe Bundler::Env do ### Gemfile.lock ``` - <No #{bundled_app("Gemfile.lock")} found> + <No #{bundled_app_lock} found> ``` ENV end diff --git a/spec/cache/gems_spec.rb b/spec/cache/gems_spec.rb index 89d6d41570..b82ccbbd30 100644 --- a/spec/cache/gems_spec.rb +++ b/spec/cache/gems_spec.rb @@ -69,7 +69,7 @@ RSpec.describe "bundle cache" do bundle "cache" - expect(bundled_app("Gemfile.lock")).to exist + expect(bundled_app_lock).to exist end end @@ -165,11 +165,11 @@ RSpec.describe "bundle cache" do end it "should not explode if the lockfile is not present" do - FileUtils.rm(bundled_app("Gemfile.lock")) + FileUtils.rm(bundled_app_lock) bundle :cache - expect(bundled_app("Gemfile.lock")).to exist + expect(bundled_app_lock).to exist end end diff --git a/spec/commands/binstubs_spec.rb b/spec/commands/binstubs_spec.rb index b24392caa1..0c86e4cdb6 100644 --- a/spec/commands/binstubs_spec.rb +++ b/spec/commands/binstubs_spec.rb @@ -221,7 +221,7 @@ RSpec.describe "bundle binstubs <gem>" do context "without a lockfile" do it "falls back to the latest installed bundler" do - FileUtils.rm bundled_app("Gemfile.lock") + FileUtils.rm bundled_app_lock sys_exec! bundled_app("bin/bundle").to_s expect(out).to eq "system bundler #{system_bundler_version}\n[]" end diff --git a/spec/commands/check_spec.rb b/spec/commands/check_spec.rb index c755ef2804..46a5aaa75a 100644 --- a/spec/commands/check_spec.rb +++ b/spec/commands/check_spec.rb @@ -33,7 +33,7 @@ RSpec.describe "bundle check" do bundle "check" - expect(bundled_app("Gemfile.lock")).to exist + expect(bundled_app_lock).to exist end it "does not create a Gemfile.lock if --dry-run was passed" do @@ -46,7 +46,7 @@ RSpec.describe "bundle check" do bundle "check --dry-run" - expect(bundled_app("Gemfile.lock")).not_to exist + expect(bundled_app_lock).not_to exist end it "prints a generic error if the missing gems are unresolvable" do @@ -232,7 +232,7 @@ RSpec.describe "bundle check" do G bundle! "install", forgotten_command_line_options(:deployment => true) - FileUtils.rm(bundled_app("Gemfile.lock")) + FileUtils.rm(bundled_app_lock) bundle :check expect(last_command).to be_failure diff --git a/spec/commands/clean_spec.rb b/spec/commands/clean_spec.rb index 471ddb0805..590852b02d 100644 --- a/spec/commands/clean_spec.rb +++ b/spec/commands/clean_spec.rb @@ -585,11 +585,11 @@ RSpec.describe "bundle clean" do bundle "install" # mimic 7 length git revisions in Gemfile.lock - gemfile_lock = File.read(bundled_app("Gemfile.lock")).split("\n") + gemfile_lock = File.read(bundled_app_lock).split("\n") gemfile_lock.each_with_index do |line, index| gemfile_lock[index] = line[0..(11 + 7)] if line.include?(" revision:") end - lockfile(bundled_app("Gemfile.lock"), gemfile_lock.join("\n")) + lockfile(bundled_app_lock, gemfile_lock.join("\n")) bundle "config set path vendor/bundle" bundle "install" diff --git a/spec/commands/info_spec.rb b/spec/commands/info_spec.rb index 4feab54d4a..a01360a023 100644 --- a/spec/commands/info_spec.rb +++ b/spec/commands/info_spec.rb @@ -15,7 +15,7 @@ RSpec.describe "bundle info" do bundle! "info rails" - expect(bundled_app("Gemfile.lock")).to exist + expect(bundled_app_lock).to exist end it "prints information if gem exists in bundle" do diff --git a/spec/commands/inject_spec.rb b/spec/commands/inject_spec.rb index 01c1f91877..c5c63935af 100644 --- a/spec/commands/inject_spec.rb +++ b/spec/commands/inject_spec.rb @@ -10,9 +10,9 @@ RSpec.describe "bundle inject", :bundler => "< 3" do context "without a lockfile" do it "locks with the injected gems" do - expect(bundled_app("Gemfile.lock")).not_to exist + expect(bundled_app_lock).not_to exist bundle "inject 'rack-obama' '> 0'" - expect(bundled_app("Gemfile.lock").read).to match(/rack-obama/) + expect(bundled_app_lock.read).to match(/rack-obama/) end end @@ -28,9 +28,9 @@ RSpec.describe "bundle inject", :bundler => "< 3" do end it "locks with the injected gems" do - expect(bundled_app("Gemfile.lock").read).not_to match(/rack-obama/) + expect(bundled_app_lock.read).not_to match(/rack-obama/) bundle "inject 'rack-obama' '> 0'" - expect(bundled_app("Gemfile.lock").read).to match(/rack-obama/) + expect(bundled_app_lock.read).to match(/rack-obama/) end end @@ -92,9 +92,9 @@ Usage: "bundle inject GEM VERSION" end it "locks with the injected gems" do - expect(bundled_app("Gemfile.lock").read).not_to match(/rack-obama/) + expect(bundled_app_lock.read).not_to match(/rack-obama/) bundle "inject 'rack-obama' '> 0'" - expect(bundled_app("Gemfile.lock").read).to match(/rack-obama/) + expect(bundled_app_lock.read).to match(/rack-obama/) end it "restores frozen afterwards" do @@ -111,7 +111,7 @@ Usage: "bundle inject GEM VERSION" bundle "inject 'rack' '> 0'" expect(err).to match(/trying to install in deployment mode after changing/) - expect(bundled_app("Gemfile.lock").read).not_to match(/rack-obama/) + expect(bundled_app_lock.read).not_to match(/rack-obama/) end end end diff --git a/spec/commands/install_spec.rb b/spec/commands/install_spec.rb index c79e44677a..8acf2202bb 100644 --- a/spec/commands/install_spec.rb +++ b/spec/commands/install_spec.rb @@ -17,7 +17,7 @@ RSpec.describe "bundle install with gem sources" do G expect(err).to include('StandardError, "FAIL"') - expect(bundled_app("Gemfile.lock")).not_to exist + expect(bundled_app_lock).not_to exist end it "creates a Gemfile.lock" do @@ -26,7 +26,7 @@ RSpec.describe "bundle install with gem sources" do gem "rack" G - expect(bundled_app("Gemfile.lock")).to exist + expect(bundled_app_lock).to exist end it "does not create ./.bundle by default", :bundler => "< 3" do @@ -66,13 +66,13 @@ RSpec.describe "bundle install with gem sources" do gem 'rack' G - lockfile = File.read(bundled_app("Gemfile.lock")) + lockfile = File.read(bundled_app_lock) install_gemfile <<-G raise StandardError, "FAIL" G - expect(File.read(bundled_app("Gemfile.lock"))).to eq(lockfile) + expect(File.read(bundled_app_lock)).to eq(lockfile) end it "does not touch the lockfile if nothing changed" do @@ -81,7 +81,7 @@ RSpec.describe "bundle install with gem sources" do gem "rack" G - expect { run "1" }.not_to change { File.mtime(bundled_app("Gemfile.lock")) } + expect { run "1" }.not_to change { File.mtime(bundled_app_lock) } end it "fetches gems" do @@ -320,7 +320,7 @@ RSpec.describe "bundle install with gem sources" do install_gemfile <<-G G - expect(File.exist?(bundled_app("Gemfile.lock"))).to eq(true) + expect(File.exist?(bundled_app_lock)).to eq(true) end context "throws a warning if a gem is added twice in Gemfile" do diff --git a/spec/commands/show_spec.rb b/spec/commands/show_spec.rb index b21892bae2..3a1fcc1a7a 100644 --- a/spec/commands/show_spec.rb +++ b/spec/commands/show_spec.rb @@ -14,7 +14,7 @@ RSpec.describe "bundle show", :bundler => "< 3" do bundle! "show" - expect(bundled_app("Gemfile.lock")).to exist + expect(bundled_app_lock).to exist end it "creates a Gemfile.lock when invoked with a gem name" do @@ -22,7 +22,7 @@ RSpec.describe "bundle show", :bundler => "< 3" do bundle! "show rails" - expect(bundled_app("Gemfile.lock")).to exist + expect(bundled_app_lock).to exist end it "prints path if gem exists in bundle" do diff --git a/spec/commands/update_spec.rb b/spec/commands/update_spec.rb index e4449312eb..8455d140fe 100644 --- a/spec/commands/update_spec.rb +++ b/spec/commands/update_spec.rb @@ -31,7 +31,7 @@ RSpec.describe "bundle update" do exit! G bundle "update" - expect(bundled_app("Gemfile.lock")).to exist + expect(bundled_app_lock).to exist end end @@ -54,7 +54,7 @@ RSpec.describe "bundle update" do exit! G bundle "update", :all => true - expect(bundled_app("Gemfile.lock")).to exist + expect(bundled_app_lock).to exist end end diff --git a/spec/install/gemfile/git_spec.rb b/spec/install/gemfile/git_spec.rb index c916664bd9..249ed48eab 100644 --- a/spec/install/gemfile/git_spec.rb +++ b/spec/install/gemfile/git_spec.rb @@ -481,7 +481,7 @@ RSpec.describe "bundle install with git sources" do gem "rack", :git => "#{lib_path("rack-0.8")}", :branch => "master" G - lockfile0 = File.read(bundled_app("Gemfile.lock")) + lockfile0 = File.read(bundled_app_lock) FileUtils.cp_r("#{lib_path("rack-0.8")}/.", lib_path("local-rack")) update_git "rack", "0.8", :path => lib_path("local-rack") do |s| @@ -491,7 +491,7 @@ RSpec.describe "bundle install with git sources" do bundle %(config set local.rack #{lib_path("local-rack")}) run "require 'rack'" - lockfile1 = File.read(bundled_app("Gemfile.lock")) + lockfile1 = File.read(bundled_app_lock) expect(lockfile1).not_to eq(lockfile0) end @@ -503,7 +503,7 @@ RSpec.describe "bundle install with git sources" do gem "rack", :git => "#{lib_path("rack-0.8")}", :branch => "master" G - lockfile0 = File.read(bundled_app("Gemfile.lock")) + lockfile0 = File.read(bundled_app_lock) FileUtils.cp_r("#{lib_path("rack-0.8")}/.", lib_path("local-rack")) update_git "rack", "0.8", :path => lib_path("local-rack") @@ -511,7 +511,7 @@ RSpec.describe "bundle install with git sources" do bundle %(config set local.rack #{lib_path("local-rack")}) bundle :install - lockfile1 = File.read(bundled_app("Gemfile.lock")) + lockfile1 = File.read(bundled_app_lock) expect(lockfile1).not_to eq(lockfile0) end @@ -965,7 +965,7 @@ RSpec.describe "bundle install with git sources" do gem "bar", :git => "#{lib_path("nested")}" G - expect(File.read(bundled_app("Gemfile.lock")).scan("GIT").size).to eq(1) + expect(File.read(bundled_app_lock).scan("GIT").size).to eq(1) end describe "switching sources" do @@ -1025,8 +1025,8 @@ RSpec.describe "bundle install with git sources" do update_git "valim" new_revision = revision_for(lib_path("valim-1.0")) - old_lockfile = File.read(bundled_app("Gemfile.lock")) - lockfile(bundled_app("Gemfile.lock"), old_lockfile.gsub(/revision: #{old_revision}/, "revision: #{new_revision}")) + old_lockfile = File.read(bundled_app_lock) + lockfile(bundled_app_lock, old_lockfile.gsub(/revision: #{old_revision}/, "revision: #{new_revision}")) bundle "install" diff --git a/spec/install/gems/flex_spec.rb b/spec/install/gems/flex_spec.rb index 865bc7b72a..77891acc24 100644 --- a/spec/install/gems/flex_spec.rb +++ b/spec/install/gems/flex_spec.rb @@ -233,7 +233,7 @@ RSpec.describe "bundle flex_install" do it "does something" do expect do bundle "install" - end.not_to change { File.read(bundled_app("Gemfile.lock")) } + end.not_to change { File.read(bundled_app_lock) } expect(err).to include("rack = 0.9.1") expect(err).to include("locked at 1.0.0") diff --git a/spec/install/gems/win32_spec.rb b/spec/install/gems/win32_spec.rb index 01edcca803..972a455bee 100644 --- a/spec/install/gems/win32_spec.rb +++ b/spec/install/gems/win32_spec.rb @@ -2,7 +2,7 @@ RSpec.describe "bundle install with win32-generated lockfile" do it "should read lockfile" do - File.open(bundled_app("Gemfile.lock"), "wb") do |f| + File.open(bundled_app_lock, "wb") do |f| f << "GEM\r\n" f << " remote: #{file_uri_for(gem_repo1)}/\r\n" f << " specs:\r\n" diff --git a/spec/lock/lockfile_spec.rb b/spec/lock/lockfile_spec.rb index 0f5a0c6e52..afcb89ba8a 100644 --- a/spec/lock/lockfile_spec.rb +++ b/spec/lock/lockfile_spec.rb @@ -1211,7 +1211,7 @@ RSpec.describe "the lockfile format" do gem "rack", "1.1" G - expect(bundled_app("Gemfile.lock")).not_to exist + expect(bundled_app_lock).not_to exist expect(err).to include "rack (= 1.0) and rack (= 1.1)" end @@ -1222,7 +1222,7 @@ RSpec.describe "the lockfile format" do gem "rack", :git => "git://hubz.com" G - expect(bundled_app("Gemfile.lock")).not_to exist + expect(bundled_app_lock).not_to exist expect(err).to include "rack (>= 0) should come from an unspecified source and git://hubz.com (at master)" end @@ -1378,7 +1378,7 @@ RSpec.describe "the lockfile format" do describe "a line ending" do def set_lockfile_mtime_to_known_value time = Time.local(2000, 1, 1, 0, 0, 0) - File.utime(time, time, bundled_app("Gemfile.lock")) + File.utime(time, time, bundled_app_lock) end before(:each) do build_repo2 @@ -1391,7 +1391,7 @@ RSpec.describe "the lockfile format" do end it "generates Gemfile.lock with \\n line endings" do - expect(File.read(bundled_app("Gemfile.lock"))).not_to match("\r\n") + expect(File.read(bundled_app_lock)).not_to match("\r\n") expect(the_bundle).to include_gems "rack 1.0" end @@ -1399,8 +1399,8 @@ RSpec.describe "the lockfile format" do it "preserves Gemfile.lock \\n line endings" do update_repo2 - expect { bundle "update", :all => true }.to change { File.mtime(bundled_app("Gemfile.lock")) } - expect(File.read(bundled_app("Gemfile.lock"))).not_to match("\r\n") + expect { bundle "update", :all => true }.to change { File.mtime(bundled_app_lock) } + expect(File.read(bundled_app_lock)).not_to match("\r\n") expect(the_bundle).to include_gems "rack 1.2" end @@ -1408,12 +1408,12 @@ RSpec.describe "the lockfile format" do skip "needs to be adapted" if Gem.win_platform? update_repo2 - win_lock = File.read(bundled_app("Gemfile.lock")).gsub(/\n/, "\r\n") - File.open(bundled_app("Gemfile.lock"), "wb") {|f| f.puts(win_lock) } + win_lock = File.read(bundled_app_lock).gsub(/\n/, "\r\n") + File.open(bundled_app_lock, "wb") {|f| f.puts(win_lock) } set_lockfile_mtime_to_known_value - expect { bundle "update", :all => true }.to change { File.mtime(bundled_app("Gemfile.lock")) } - expect(File.read(bundled_app("Gemfile.lock"))).to match("\r\n") + expect { bundle "update", :all => true }.to change { File.mtime(bundled_app_lock) } + expect(File.read(bundled_app_lock)).to match("\r\n") expect(the_bundle).to include_gems "rack 1.2" end end @@ -1425,12 +1425,12 @@ RSpec.describe "the lockfile format" do require 'bundler' Bundler.setup RUBY - end.not_to change { File.mtime(bundled_app("Gemfile.lock")) } + end.not_to change { File.mtime(bundled_app_lock) } end it "preserves Gemfile.lock \\n\\r line endings" do - win_lock = File.read(bundled_app("Gemfile.lock")).gsub(/\n/, "\r\n") - File.open(bundled_app("Gemfile.lock"), "wb") {|f| f.puts(win_lock) } + win_lock = File.read(bundled_app_lock).gsub(/\n/, "\r\n") + File.open(bundled_app_lock, "wb") {|f| f.puts(win_lock) } set_lockfile_mtime_to_known_value expect do @@ -1438,7 +1438,7 @@ RSpec.describe "the lockfile format" do require 'bundler' Bundler.setup RUBY - end.not_to change { File.mtime(bundled_app("Gemfile.lock")) } + end.not_to change { File.mtime(bundled_app_lock) } end end end diff --git a/spec/other/platform_spec.rb b/spec/other/platform_spec.rb index da35c6a0af..9c8df44acc 100644 --- a/spec/other/platform_spec.rb +++ b/spec/other/platform_spec.rb @@ -298,7 +298,7 @@ G #{ruby_version_correct} G - expect(bundled_app("Gemfile.lock")).to exist + expect(bundled_app_lock).to exist end it "installs fine with any engine" do @@ -310,7 +310,7 @@ G #{ruby_version_correct_engineless} G - expect(bundled_app("Gemfile.lock")).to exist + expect(bundled_app_lock).to exist end end @@ -322,7 +322,7 @@ G #{ruby_version_correct_patchlevel} G - expect(bundled_app("Gemfile.lock")).to exist + expect(bundled_app_lock).to exist end it "doesn't install when the ruby version doesn't match" do @@ -333,7 +333,7 @@ G #{ruby_version_incorrect} G - expect(bundled_app("Gemfile.lock")).not_to exist + expect(bundled_app_lock).not_to exist should_be_ruby_version_incorrect end @@ -345,7 +345,7 @@ G #{engine_incorrect} G - expect(bundled_app("Gemfile.lock")).not_to exist + expect(bundled_app_lock).not_to exist should_be_engine_incorrect end @@ -358,7 +358,7 @@ G #{engine_version_incorrect} G - expect(bundled_app("Gemfile.lock")).not_to exist + expect(bundled_app_lock).not_to exist should_be_engine_version_incorrect end end @@ -371,7 +371,7 @@ G #{patchlevel_incorrect} G - expect(bundled_app("Gemfile.lock")).not_to exist + expect(bundled_app_lock).not_to exist should_be_patchlevel_incorrect end end @@ -1051,10 +1051,10 @@ G #{ruby_version_correct} G - FileUtils.rm(bundled_app("Gemfile.lock")) + FileUtils.rm(bundled_app_lock) run "1" - expect(bundled_app("Gemfile.lock")).to exist + expect(bundled_app_lock).to exist end it "makes a Gemfile.lock if setup succeeds for any engine" do @@ -1067,10 +1067,10 @@ G #{ruby_version_correct_engineless} G - FileUtils.rm(bundled_app("Gemfile.lock")) + FileUtils.rm(bundled_app_lock) run "1" - expect(bundled_app("Gemfile.lock")).to exist + expect(bundled_app_lock).to exist end end @@ -1083,13 +1083,13 @@ G #{ruby_version_incorrect} G - FileUtils.rm(bundled_app("Gemfile.lock")) + FileUtils.rm(bundled_app_lock) ruby <<-R require 'bundler/setup' R - expect(bundled_app("Gemfile.lock")).not_to exist + expect(bundled_app_lock).not_to exist should_be_ruby_version_incorrect end @@ -1102,13 +1102,13 @@ G #{engine_incorrect} G - FileUtils.rm(bundled_app("Gemfile.lock")) + FileUtils.rm(bundled_app_lock) ruby <<-R require 'bundler/setup' R - expect(bundled_app("Gemfile.lock")).not_to exist + expect(bundled_app_lock).not_to exist should_be_engine_incorrect end @@ -1122,13 +1122,13 @@ G #{engine_version_incorrect} G - FileUtils.rm(bundled_app("Gemfile.lock")) + FileUtils.rm(bundled_app_lock) ruby <<-R require 'bundler/setup' R - expect(bundled_app("Gemfile.lock")).not_to exist + expect(bundled_app_lock).not_to exist should_be_engine_version_incorrect end end @@ -1142,13 +1142,13 @@ G #{patchlevel_incorrect} G - FileUtils.rm(bundled_app("Gemfile.lock")) + FileUtils.rm(bundled_app_lock) ruby <<-R require 'bundler/setup' R - expect(bundled_app("Gemfile.lock")).not_to exist + expect(bundled_app_lock).not_to exist should_be_patchlevel_incorrect end end diff --git a/spec/runtime/setup_spec.rb b/spec/runtime/setup_spec.rb index cab7b7cc2a..e06e877ff9 100644 --- a/spec/runtime/setup_spec.rb +++ b/spec/runtime/setup_spec.rb @@ -218,7 +218,7 @@ RSpec.describe "Bundler.setup" do Bundler.setup R - expect(bundled_app("Gemfile.lock")).not_to exist + expect(bundled_app_lock).not_to exist end it "doesn't change the Gemfile.lock if the setup fails" do @@ -227,7 +227,7 @@ RSpec.describe "Bundler.setup" do gem "rack" G - lockfile = File.read(bundled_app("Gemfile.lock")) + lockfile = File.read(bundled_app_lock) gemfile <<-G source "#{file_uri_for(gem_repo1)}" @@ -241,7 +241,7 @@ RSpec.describe "Bundler.setup" do Bundler.setup R - expect(File.read(bundled_app("Gemfile.lock"))).to eq(lockfile) + expect(File.read(bundled_app_lock)).to eq(lockfile) end it "makes a Gemfile.lock if setup succeeds" do @@ -250,12 +250,12 @@ RSpec.describe "Bundler.setup" do gem "rack" G - File.read(bundled_app("Gemfile.lock")) + File.read(bundled_app_lock) - FileUtils.rm(bundled_app("Gemfile.lock")) + FileUtils.rm(bundled_app_lock) run "1" - expect(bundled_app("Gemfile.lock")).to exist + expect(bundled_app_lock).to exist end describe "$BUNDLE_GEMFILE" do @@ -460,7 +460,7 @@ RSpec.describe "Bundler.setup" do it "provides a good exception if the lockfile is unavailable" do bundle "install" - FileUtils.rm(bundled_app("Gemfile.lock")) + FileUtils.rm(bundled_app_lock) break_git! diff --git a/spec/support/matchers.rb b/spec/support/matchers.rb index df35854c2f..37461901fc 100644 --- a/spec/support/matchers.rb +++ b/spec/support/matchers.rb @@ -214,7 +214,7 @@ module Spec end def lockfile_should_be(expected) - expect(bundled_app("Gemfile.lock")).to have_lockfile(expected) + expect(bundled_app_lock).to have_lockfile(expected) end def gemfile_should_be(expected) diff --git a/spec/support/path.rb b/spec/support/path.rb index 0c80fe5551..7d3c96ea02 100644 --- a/spec/support/path.rb +++ b/spec/support/path.rb @@ -96,6 +96,10 @@ module Spec bundled_app("vendor/cache/#{path}.gem") end + def bundled_app_lock + bundled_app("Gemfile.lock") + end + def base_system_gems tmp.join("gems/base") end |