From d0f266460f982137e24af2fbf3f7eeaaa8d47210 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Rodr=C3=ADguez?= Date: Thu, 11 Nov 2021 20:24:02 +0100 Subject: [PATCH] [rubygems/rubygems] Remove `lockfile_should_be` helper It doesn't add anything. https://github.com/rubygems/rubygems/commit/ece3c864df --- spec/bundler/bundler/definition_spec.rb | 8 +- spec/bundler/commands/check_spec.rb | 10 +-- spec/bundler/commands/install_spec.rb | 4 +- spec/bundler/commands/lock_spec.rb | 6 +- spec/bundler/commands/update_spec.rb | 6 +- .../install/gemfile/install_if_spec.rb | 2 +- spec/bundler/install/gemfile/path_spec.rb | 8 +- spec/bundler/install/gemfile/platform_spec.rb | 22 +++--- .../install/gemfile/specific_platform_spec.rb | 2 +- spec/bundler/install/gems/flex_spec.rb | 28 +++---- spec/bundler/lock/lockfile_spec.rb | 74 +++++++++---------- spec/bundler/plugins/source/example_spec.rb | 4 +- spec/bundler/runtime/setup_spec.rb | 16 ++-- spec/bundler/support/matchers.rb | 4 - spec/bundler/update/git_spec.rb | 4 +- 15 files changed, 97 insertions(+), 101 deletions(-) diff --git a/spec/bundler/bundler/definition_spec.rb b/spec/bundler/bundler/definition_spec.rb index 728945c401..2618786e7c 100644 --- a/spec/bundler/bundler/definition_spec.rb +++ b/spec/bundler/bundler/definition_spec.rb @@ -59,7 +59,7 @@ RSpec.describe Bundler::Definition do bundle :install, :env => { "DEBUG" => "1" } expect(out).to match(/re-resolving dependencies/) - lockfile_should_be <<-G + expect(lockfile).to eq <<~G PATH remote: #{lib_path("foo")} specs: @@ -96,7 +96,7 @@ RSpec.describe Bundler::Definition do bundle :check, :env => { "DEBUG" => "1" } expect(out).to match(/using resolution from the lockfile/) - lockfile_should_be <<-G + expect(lockfile).to eq <<~G PATH remote: #{lib_path("foo")} specs: @@ -129,7 +129,7 @@ RSpec.describe Bundler::Definition do bundle :check, :env => { "DEBUG" => "1" } expect(out).to match(/using resolution from the lockfile/) - lockfile_should_be <<-G + expect(lockfile).to eq <<~G GEM remote: #{file_uri_for(gem_repo1)}/ specs: @@ -155,7 +155,7 @@ RSpec.describe Bundler::Definition do bundle :check, :env => { "DEBUG" => "1" } expect(out).to match(/using resolution from the lockfile/) - lockfile_should_be <<-G + expect(lockfile).to eq <<~G GEM remote: #{file_uri_for(gem_repo1)}/ specs: diff --git a/spec/bundler/commands/check_spec.rb b/spec/bundler/commands/check_spec.rb index 419deae19b..1fa35136eb 100644 --- a/spec/bundler/commands/check_spec.rb +++ b/spec/bundler/commands/check_spec.rb @@ -433,7 +433,7 @@ RSpec.describe "bundle check" do describe "BUNDLED WITH" do def lock_with(bundler_version = nil) - lock = <<-L + lock = <<~L GEM remote: #{file_uri_for(gem_repo1)}/ specs: @@ -447,7 +447,7 @@ RSpec.describe "bundle check" do L if bundler_version - lock += "\n BUNDLED WITH\n #{bundler_version}\n" + lock += "\nBUNDLED WITH\n #{bundler_version}\n" end lock @@ -466,7 +466,7 @@ RSpec.describe "bundle check" do it "does not change the lock" do lockfile lock_with(nil) bundle :check - lockfile_should_be lock_with(nil) + expect(lockfile).to eq lock_with(nil) end end @@ -475,7 +475,7 @@ RSpec.describe "bundle check" do lockfile lock_with(Bundler::VERSION.succ) bundle :check expect(err).to include("the running version of Bundler (#{Bundler::VERSION}) is older than the version that created the lockfile (#{Bundler::VERSION.succ})") - lockfile_should_be lock_with(Bundler::VERSION.succ) + expect(lockfile).to eq lock_with(Bundler::VERSION.succ) end end @@ -484,7 +484,7 @@ RSpec.describe "bundle check" do system_gems "bundler-1.18.0" lockfile lock_with("1.18.0") bundle :check - lockfile_should_be lock_with("1.18.0") + expect(lockfile).to eq lock_with("1.18.0") end end end diff --git a/spec/bundler/commands/install_spec.rb b/spec/bundler/commands/install_spec.rb index 2c7f0360e6..e00caa5315 100644 --- a/spec/bundler/commands/install_spec.rb +++ b/spec/bundler/commands/install_spec.rb @@ -518,7 +518,7 @@ RSpec.describe "bundle install with gem sources" do end it "writes current Ruby version to Gemfile.lock" do - lockfile_should_be <<-L + expect(lockfile).to eq <<~L GEM remote: #{file_uri_for(gem_repo1)}/ specs: @@ -544,7 +544,7 @@ RSpec.describe "bundle install with gem sources" do source "#{file_uri_for(gem_repo1)}" G - lockfile_should_be <<-L + expect(lockfile).to eq <<~L GEM remote: #{file_uri_for(gem_repo1)}/ specs: diff --git a/spec/bundler/commands/lock_spec.rb b/spec/bundler/commands/lock_spec.rb index 171ec1ba1d..22709f4528 100644 --- a/spec/bundler/commands/lock_spec.rb +++ b/spec/bundler/commands/lock_spec.rb @@ -314,7 +314,7 @@ RSpec.describe "bundle lock" do simulate_platform(mingw) { bundle :lock } - lockfile_should_be <<-G + expect(lockfile).to eq <<~G GEM remote: #{file_uri_for(gem_repo4)}/ specs: @@ -339,7 +339,7 @@ RSpec.describe "bundle lock" do simulate_platform(rb) { bundle :lock } - lockfile_should_be <<-G + expect(lockfile).to eq <<~G GEM remote: #{file_uri_for(gem_repo4)}/ specs: @@ -426,7 +426,7 @@ RSpec.describe "bundle lock" do simulate_platform(Gem::Platform.new("x86_64-darwin")) { bundle "lock" } - lockfile_should_be <<-G + expect(lockfile).to eq <<~G GEM remote: #{file_uri_for(gem_repo4)}/ specs: diff --git a/spec/bundler/commands/update_spec.rb b/spec/bundler/commands/update_spec.rb index 14fe3e245b..c8f084ca0e 100644 --- a/spec/bundler/commands/update_spec.rb +++ b/spec/bundler/commands/update_spec.rb @@ -939,7 +939,7 @@ RSpec.describe "bundle update --ruby" do it "removes the Ruby from the Gemfile.lock" do bundle "update --ruby" - lockfile_should_be <<-L + expect(lockfile).to eq <<~L GEM remote: #{file_uri_for(gem_repo1)}/ specs: @@ -967,7 +967,7 @@ RSpec.describe "bundle update --ruby" do it "updates the Gemfile.lock with the latest version" do bundle "update --ruby" - lockfile_should_be <<-L + expect(lockfile).to eq <<~L GEM remote: #{file_uri_for(gem_repo1)}/ specs: @@ -1014,7 +1014,7 @@ RSpec.describe "bundle update --ruby" do it "updates the Gemfile.lock with the latest version" do bundle "update --ruby" - lockfile_should_be <<-L + expect(lockfile).to eq <<~L GEM remote: #{file_uri_for(gem_repo1)}/ specs: diff --git a/spec/bundler/install/gemfile/install_if_spec.rb b/spec/bundler/install/gemfile/install_if_spec.rb index 786e0e9258..3d2d15a698 100644 --- a/spec/bundler/install/gemfile/install_if_spec.rb +++ b/spec/bundler/install/gemfile/install_if_spec.rb @@ -18,7 +18,7 @@ RSpec.describe "bundle install with install_if conditionals" do expect(the_bundle).not_to include_gems("thin") expect(the_bundle).not_to include_gems("foo") - lockfile_should_be <<-L + expect(lockfile).to eq <<~L GEM remote: #{file_uri_for(gem_repo1)}/ specs: diff --git a/spec/bundler/install/gemfile/path_spec.rb b/spec/bundler/install/gemfile/path_spec.rb index 566fdcf65a..539fe24285 100644 --- a/spec/bundler/install/gemfile/path_spec.rb +++ b/spec/bundler/install/gemfile/path_spec.rb @@ -552,7 +552,7 @@ RSpec.describe "bundle install with explicit source paths" do expect(the_bundle).to include_gems "rack 0.9.1" - lockfile_should_be <<-G + expect(lockfile).to eq <<~G PATH remote: #{lib_path("foo")} specs: @@ -580,7 +580,7 @@ RSpec.describe "bundle install with explicit source paths" do bundle "install" - lockfile_should_be <<-G + expect(lockfile).to eq <<~G PATH remote: #{lib_path("foo")} specs: @@ -614,7 +614,7 @@ RSpec.describe "bundle install with explicit source paths" do expect(the_bundle).to include_gems "rack 0.9.1" - lockfile_should_be <<-G + expect(lockfile).to eq <<~G PATH remote: #{lib_path("foo")} specs: @@ -643,7 +643,7 @@ RSpec.describe "bundle install with explicit source paths" do bundle "install" - lockfile_should_be <<-G + expect(lockfile).to eq <<~G PATH remote: #{lib_path("foo")} specs: diff --git a/spec/bundler/install/gemfile/platform_spec.rb b/spec/bundler/install/gemfile/platform_spec.rb index 7cd06b7e08..221c52c448 100644 --- a/spec/bundler/install/gemfile/platform_spec.rb +++ b/spec/bundler/install/gemfile/platform_spec.rb @@ -128,7 +128,7 @@ RSpec.describe "bundle install across platforms" do gem "pry" G - lockfile_should_be <<-L + expect(lockfile).to eq <<~L GEM remote: #{file_uri_for(gem_repo4)}/ specs: @@ -156,7 +156,7 @@ RSpec.describe "bundle install across platforms" do bundle "lock --add-platform ruby" - good_lockfile = strip_whitespace(<<-L) + good_lockfile = <<~L GEM remote: #{file_uri_for(gem_repo4)}/ specs: @@ -186,9 +186,9 @@ RSpec.describe "bundle install across platforms" do #{Bundler::VERSION} L - lockfile_should_be good_lockfile + expect(lockfile).to eq good_lockfile - bad_lockfile = strip_whitespace <<-L + bad_lockfile = <<~L GEM remote: #{file_uri_for(gem_repo4)}/ specs: @@ -222,23 +222,23 @@ RSpec.describe "bundle install across platforms" do aggregate_failures do lockfile bad_lockfile bundle :install - lockfile_should_be good_lockfile + expect(lockfile).to eq good_lockfile lockfile bad_lockfile bundle :update, :all => true - lockfile_should_be good_lockfile + expect(lockfile).to eq good_lockfile lockfile bad_lockfile bundle "update ffi" - lockfile_should_be good_lockfile + expect(lockfile).to eq good_lockfile lockfile bad_lockfile bundle "update empyrean" - lockfile_should_be good_lockfile + expect(lockfile).to eq good_lockfile lockfile bad_lockfile bundle :lock - lockfile_should_be good_lockfile + expect(lockfile).to eq good_lockfile end end @@ -310,7 +310,7 @@ RSpec.describe "bundle install across platforms" do expect(the_bundle).to include_gem "platform_specific 1.0 RUBY" - lockfile_should_be <<-G + expect(lockfile).to eq <<~G GEM remote: #{file_uri_for(gem_repo1)}/ specs: @@ -447,7 +447,7 @@ RSpec.describe "bundle install with platform conditionals" do expect(err).to be_empty - lockfile_should_be <<-L + expect(lockfile).to eq <<~L GEM remote: #{file_uri_for(gem_repo1)}/ specs: diff --git a/spec/bundler/install/gemfile/specific_platform_spec.rb b/spec/bundler/install/gemfile/specific_platform_spec.rb index 19ac8c6b78..ce2823ce9a 100644 --- a/spec/bundler/install/gemfile/specific_platform_spec.rb +++ b/spec/bundler/install/gemfile/specific_platform_spec.rb @@ -87,7 +87,7 @@ RSpec.describe "bundle install with specific platforms" do expect(the_bundle).to include_gem("google-protobuf 3.0.0.alpha.5.0.5.1 universal-darwin") # make sure we're still only locked to ruby - lockfile_should_be <<-L + expect(lockfile).to eq <<~L GEM remote: #{file_uri_for(gem_repo2)}/ specs: diff --git a/spec/bundler/install/gems/flex_spec.rb b/spec/bundler/install/gems/flex_spec.rb index 326ec51214..d4fd8d0183 100644 --- a/spec/bundler/install/gems/flex_spec.rb +++ b/spec/bundler/install/gems/flex_spec.rb @@ -259,24 +259,24 @@ RSpec.describe "bundle flex_install" do gem "rack" G - lockfile_should_be <<-L - GEM - remote: #{file_uri_for(gem_repo1)}/ - specs: - rack (1.0.0) + expect(lockfile).to eq <<~L + GEM + remote: #{file_uri_for(gem_repo1)}/ + specs: + rack (1.0.0) - GEM - remote: #{file_uri_for(gem_repo2)}/ - specs: + GEM + remote: #{file_uri_for(gem_repo2)}/ + specs: - PLATFORMS - #{lockfile_platforms} + PLATFORMS + #{lockfile_platforms} - DEPENDENCIES - rack + DEPENDENCIES + rack - BUNDLED WITH - #{Bundler::VERSION} + BUNDLED WITH + #{Bundler::VERSION} L end end diff --git a/spec/bundler/lock/lockfile_spec.rb b/spec/bundler/lock/lockfile_spec.rb index 9170efeedd..8befb0d400 100644 --- a/spec/bundler/lock/lockfile_spec.rb +++ b/spec/bundler/lock/lockfile_spec.rb @@ -22,7 +22,7 @@ RSpec.describe "the lockfile format" do gem "rack" G - lockfile_should_be <<-G + expect(lockfile).to eq <<~G GEM remote: #{file_uri_for(gem_repo2)}/ specs: @@ -70,7 +70,7 @@ RSpec.describe "the lockfile format" do gem "rack" G - lockfile_should_be <<-G + expect(lockfile).to eq <<~G GEM remote: #{file_uri_for(gem_repo2)}/ specs: @@ -112,7 +112,7 @@ RSpec.describe "the lockfile format" do gem "rack" G - lockfile_should_be <<-G + expect(lockfile).to eq <<~G GEM remote: #{file_uri_for(gem_repo2)}/ specs: @@ -149,7 +149,7 @@ RSpec.describe "the lockfile format" do gem "rack", "> 0" G - lockfile_should_be <<-G + expect(lockfile).to eq <<~G GEM remote: #{file_uri_for(gem_repo2)}/ specs: @@ -199,7 +199,7 @@ RSpec.describe "the lockfile format" do "lockfile by running `gem install bundler:#{newer_minor}`." expect(err).to include warning_message - lockfile_should_be <<-G + expect(lockfile).to eq <<~G GEM remote: #{file_uri_for(gem_repo2)}/ specs: @@ -249,7 +249,7 @@ RSpec.describe "the lockfile format" do "lockfile by running `gem install bundler:#{newer_minor} --pre`." expect(err).to include warning_message - lockfile_should_be <<-G + expect(lockfile).to eq <<~G GEM remote: #{file_uri_for(gem_repo2)}/ specs: @@ -295,7 +295,7 @@ RSpec.describe "the lockfile format" do expect(err).to be_empty - lockfile_should_be <<-G + expect(lockfile).to eq <<~G GEM remote: #{file_uri_for(gem_repo2)}/ specs: @@ -345,7 +345,7 @@ RSpec.describe "the lockfile format" do "#{current_version.split(".").first}, after which you will be unable to return to Bundler #{older_major.split(".").first}." ) - lockfile_should_be <<-G + expect(lockfile).to eq <<~G GEM remote: #{file_uri_for(gem_repo2)}/ specs: @@ -369,7 +369,7 @@ RSpec.describe "the lockfile format" do gem "rack-obama" G - lockfile_should_be <<-G + expect(lockfile).to eq <<~G GEM remote: #{file_uri_for(gem_repo2)}/ specs: @@ -395,7 +395,7 @@ RSpec.describe "the lockfile format" do gem "rack-obama", ">= 1.0" G - lockfile_should_be <<-G + expect(lockfile).to eq <<~G GEM remote: #{file_uri_for(gem_repo2)}/ specs: @@ -429,7 +429,7 @@ RSpec.describe "the lockfile format" do end G - lockfile_should_be <<-G + expect(lockfile).to eq <<~G GEM remote: #{file_uri_for(gem_repo1)}/ specs: @@ -462,7 +462,7 @@ RSpec.describe "the lockfile format" do gem "net-sftp" G - lockfile_should_be <<-G + expect(lockfile).to eq <<~G GEM remote: #{file_uri_for(gem_repo2)}/ specs: @@ -491,7 +491,7 @@ RSpec.describe "the lockfile format" do gem "foo", :git => "#{lib_path("foo-1.0")}" G - lockfile_should_be <<-G + expect(lockfile).to eq <<~G GIT remote: #{lib_path("foo-1.0")} revision: #{git.ref_for("master")} @@ -562,7 +562,7 @@ RSpec.describe "the lockfile format" do end G - lockfile_should_be <<-G + expect(lockfile).to eq <<~G GIT remote: #{lib_path("foo-1.0")} revision: #{git.ref_for("master")} @@ -593,7 +593,7 @@ RSpec.describe "the lockfile format" do gem "foo", :git => "#{lib_path("foo-1.0")}", :branch => "omg" G - lockfile_should_be <<-G + expect(lockfile).to eq <<~G GIT remote: #{lib_path("foo-1.0")} revision: #{git.ref_for("omg")} @@ -625,7 +625,7 @@ RSpec.describe "the lockfile format" do gem "foo", :git => "#{lib_path("foo-1.0")}", :tag => "omg" G - lockfile_should_be <<-G + expect(lockfile).to eq <<~G GIT remote: #{lib_path("foo-1.0")} revision: #{git.ref_for("omg")} @@ -656,7 +656,7 @@ RSpec.describe "the lockfile format" do gem "foo", :path => "#{lib_path("foo-1.0")}" G - lockfile_should_be <<-G + expect(lockfile).to eq <<~G PATH remote: #{lib_path("foo-1.0")} specs: @@ -689,7 +689,7 @@ RSpec.describe "the lockfile format" do bundle :cache bundle :install, :local => true - lockfile_should_be <<-G + expect(lockfile).to eq <<~G PATH remote: #{lib_path("foo-1.0")} specs: @@ -722,7 +722,7 @@ RSpec.describe "the lockfile format" do gem "bar", :git => "#{lib_path("bar-1.0")}" G - lockfile_should_be <<-G + expect(lockfile).to eq <<~G GIT remote: #{lib_path("bar-1.0")} revision: #{bar.ref_for("master")} @@ -759,7 +759,7 @@ RSpec.describe "the lockfile format" do gem "rack", :source => "#{file_uri_for(gem_repo2)}/" G - lockfile_should_be <<-G + expect(lockfile).to eq <<~G GEM remote: #{file_uri_for(gem_repo2)}/ specs: @@ -785,7 +785,7 @@ RSpec.describe "the lockfile format" do gem "rack-obama" G - lockfile_should_be <<-G + expect(lockfile).to eq <<~G GEM remote: #{file_uri_for(gem_repo2)}/ specs: @@ -818,7 +818,7 @@ RSpec.describe "the lockfile format" do gem "rails" G - lockfile_should_be <<-G + expect(lockfile).to eq <<~G GEM remote: #{file_uri_for(gem_repo2)}/ specs: @@ -856,7 +856,7 @@ RSpec.describe "the lockfile format" do gem 'double_deps' G - lockfile_should_be <<-G + expect(lockfile).to eq <<~G GEM remote: #{file_uri_for(gem_repo2)}/ specs: @@ -883,7 +883,7 @@ RSpec.describe "the lockfile format" do gem "rack-obama", ">= 1.0", :require => "rack/obama" G - lockfile_should_be <<-G + expect(lockfile).to eq <<~G GEM remote: #{file_uri_for(gem_repo2)}/ specs: @@ -909,7 +909,7 @@ RSpec.describe "the lockfile format" do gem "rack-obama", ">= 1.0", :group => :test G - lockfile_should_be <<-G + expect(lockfile).to eq <<~G GEM remote: #{file_uri_for(gem_repo2)}/ specs: @@ -938,7 +938,7 @@ RSpec.describe "the lockfile format" do end G - lockfile_should_be <<-G + expect(lockfile).to eq <<~G PATH remote: foo specs: @@ -969,7 +969,7 @@ RSpec.describe "the lockfile format" do end G - lockfile_should_be <<-G + expect(lockfile).to eq <<~G PATH remote: ../foo specs: @@ -1000,7 +1000,7 @@ RSpec.describe "the lockfile format" do end G - lockfile_should_be <<-G + expect(lockfile).to eq <<~G PATH remote: foo specs: @@ -1029,7 +1029,7 @@ RSpec.describe "the lockfile format" do gemspec :path => "../foo" G - lockfile_should_be <<-G + expect(lockfile).to eq <<~G PATH remote: ../foo specs: @@ -1073,7 +1073,7 @@ RSpec.describe "the lockfile format" do gem "rack" G - lockfile_should_be <<-G + expect(lockfile).to eq <<~G GEM remote: #{file_uri_for(gem_repo2)}/ specs: @@ -1104,7 +1104,7 @@ RSpec.describe "the lockfile format" do gem "platform_specific" G - lockfile_should_be <<-G + expect(lockfile).to eq <<~G GEM remote: #{file_uri_for(gem_repo2)}/ specs: @@ -1133,7 +1133,7 @@ RSpec.describe "the lockfile format" do gem "activesupport" G - lockfile_should_be <<-G + expect(lockfile).to eq <<~G GEM remote: #{file_uri_for(gem_repo2)}/ specs: @@ -1159,7 +1159,7 @@ RSpec.describe "the lockfile format" do gem "rack" G - lockfile_should_be <<-G + expect(lockfile).to eq <<~G GEM remote: #{file_uri_for(gem_repo2)}/ specs: @@ -1183,7 +1183,7 @@ RSpec.describe "the lockfile format" do gem "rack", "1.0" G - lockfile_should_be <<-G + expect(lockfile).to eq <<~G GEM remote: #{file_uri_for(gem_repo2)}/ specs: @@ -1207,7 +1207,7 @@ RSpec.describe "the lockfile format" do gem "rack", "1.0", :group => :two G - lockfile_should_be <<-G + expect(lockfile).to eq <<~G GEM remote: #{file_uri_for(gem_repo2)}/ specs: @@ -1252,7 +1252,7 @@ RSpec.describe "the lockfile format" do gem "rack", "> 0.9", "< 1.0" G - lockfile_should_be <<-G + expect(lockfile).to eq <<~G GEM remote: #{file_uri_for(gem_repo2)}/ specs: @@ -1276,7 +1276,7 @@ RSpec.describe "the lockfile format" do gem "rack", "> 0.9", "< 1.0" G - lockfile_should_be <<-G + expect(lockfile).to eq <<~G GEM remote: #{file_uri_for(gem_repo2)}/ specs: diff --git a/spec/bundler/plugins/source/example_spec.rb b/spec/bundler/plugins/source/example_spec.rb index e2bab9c199..7d098997ec 100644 --- a/spec/bundler/plugins/source/example_spec.rb +++ b/spec/bundler/plugins/source/example_spec.rb @@ -70,7 +70,7 @@ RSpec.describe "real source plugins" do it "writes to lock file" do bundle "install" - lockfile_should_be <<-G + expect(lockfile).to eq <<~G PLUGIN SOURCE remote: #{lib_path("a-path-gem-1.0")} type: mpath @@ -342,7 +342,7 @@ RSpec.describe "real source plugins" do revision = revision_for(lib_path("ma-gitp-gem-1.0")) bundle "install" - lockfile_should_be <<-G + expect(lockfile).to eq <<~G PLUGIN SOURCE remote: #{file_uri_for(lib_path("ma-gitp-gem-1.0"))} type: gitp diff --git a/spec/bundler/runtime/setup_spec.rb b/spec/bundler/runtime/setup_spec.rb index 00fed52011..804e29c3c1 100644 --- a/spec/bundler/runtime/setup_spec.rb +++ b/spec/bundler/runtime/setup_spec.rb @@ -1135,7 +1135,7 @@ end describe "when BUNDLED WITH" do def lock_with(bundler_version = nil) - lock = <<-L + lock = <<~L GEM remote: #{file_uri_for(gem_repo1)}/ specs: @@ -1149,7 +1149,7 @@ end L if bundler_version - lock += "\n BUNDLED WITH\n #{bundler_version}\n" + lock += "\nBUNDLED WITH\n #{bundler_version}\n" end lock @@ -1168,7 +1168,7 @@ end it "does not change the lock" do lockfile lock_with(nil) ruby "require '#{entrypoint}/setup'" - lockfile_should_be lock_with(nil) + expect(lockfile).to eq lock_with(nil) end end @@ -1178,7 +1178,7 @@ end ruby "require 'bundler/setup'" expect(out).to be_empty expect(err).to be_empty - lockfile_should_be lock_with(Bundler::VERSION.succ) + expect(lockfile).to eq lock_with(Bundler::VERSION.succ) end end @@ -1187,7 +1187,7 @@ end system_gems "bundler-1.10.1" lockfile lock_with("1.10.1") ruby "require '#{entrypoint}/setup'" - lockfile_should_be lock_with("1.10.1") + expect(lockfile).to eq lock_with("1.10.1") end end end @@ -1196,7 +1196,7 @@ end let(:ruby_version) { nil } def lock_with(ruby_version = nil) - lock = <<-L + lock = <<~L GEM remote: #{file_uri_for(gem_repo1)}/ specs: @@ -1210,10 +1210,10 @@ end L if ruby_version - lock += "\n RUBY VERSION\n ruby #{ruby_version}\n" + lock += "\nRUBY VERSION\n ruby #{ruby_version}\n" end - lock += <<-L + lock += <<~L BUNDLED WITH #{Bundler::VERSION} diff --git a/spec/bundler/support/matchers.rb b/spec/bundler/support/matchers.rb index 180ad54c5b..f648321383 100644 --- a/spec/bundler/support/matchers.rb +++ b/spec/bundler/support/matchers.rb @@ -226,10 +226,6 @@ module Spec end end - def lockfile_should_be(expected) - expect(bundled_app_lock).to have_lockfile(expected) - end - def gemfile_should_be(expected) expect(bundled_app_gemfile).to read_as(strip_whitespace(expected)) end diff --git a/spec/bundler/update/git_spec.rb b/spec/bundler/update/git_spec.rb index f35d5857c6..af014c5fe0 100644 --- a/spec/bundler/update/git_spec.rb +++ b/spec/bundler/update/git_spec.rb @@ -305,7 +305,7 @@ RSpec.describe "bundle update" do bundle "update --source bar" - lockfile_should_be <<-G + expect(lockfile).to eq <<~G GIT remote: #{@git.path} revision: #{ref} @@ -341,7 +341,7 @@ RSpec.describe "bundle update" do bundle "update --source bar" - lockfile_should_be <<-G + expect(lockfile).to eq <<~G GIT remote: #{@git.path} revision: #{ref}