1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

[rubygems/rubygems] Remove lockfile_should_be helper

It doesn't add anything.

https://github.com/rubygems/rubygems/commit/ece3c864df
This commit is contained in:
David Rodríguez 2021-11-11 20:24:02 +01:00 committed by git
parent 84202963c5
commit d0f266460f
15 changed files with 97 additions and 101 deletions

View file

@ -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:

View file

@ -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:
@ -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

View file

@ -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:

View file

@ -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:

View file

@ -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:

View file

@ -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:

View file

@ -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:

View file

@ -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:

View file

@ -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:

View file

@ -259,7 +259,7 @@ RSpec.describe "bundle flex_install" do
gem "rack"
G
lockfile_should_be <<-L
expect(lockfile).to eq <<~L
GEM
remote: #{file_uri_for(gem_repo1)}/
specs:

View file

@ -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:

View file

@ -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

View file

@ -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:
@ -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:
@ -1213,7 +1213,7 @@ end
lock += "\nRUBY VERSION\n ruby #{ruby_version}\n"
end
lock += <<-L
lock += <<~L
BUNDLED WITH
#{Bundler::VERSION}

View file

@ -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

View file

@ -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}