Skip to content

Commit

Permalink
[rubygems/rubygems] Remove lockfile_should_be helper
Browse files Browse the repository at this point in the history
It doesn't add anything.

rubygems/rubygems@ece3c864df
  • Loading branch information
deivid-rodriguez authored and matzbot committed Nov 11, 2021
1 parent 8420296 commit d0f2664
Show file tree
Hide file tree
Showing 15 changed files with 97 additions and 101 deletions.
8 changes: 4 additions & 4 deletions spec/bundler/bundler/definition_spec.rb
Expand Up @@ -59,7 +59,7 @@
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:
Expand Down Expand Up @@ -96,7 +96,7 @@
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:
Expand Down Expand Up @@ -129,7 +129,7 @@
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:
Expand All @@ -155,7 +155,7 @@
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:
Expand Down
10 changes: 5 additions & 5 deletions spec/bundler/commands/check_spec.rb
Expand Up @@ -433,7 +433,7 @@

describe "BUNDLED WITH" do
def lock_with(bundler_version = nil)
lock = <<-L
lock = <<~L
GEM
remote: #{file_uri_for(gem_repo1)}/
specs:
Expand All @@ -447,7 +447,7 @@ def lock_with(bundler_version = nil)
L

if bundler_version
lock += "\n BUNDLED WITH\n #{bundler_version}\n"
lock += "\nBUNDLED WITH\n #{bundler_version}\n"
end

lock
Expand All @@ -466,7 +466,7 @@ def lock_with(bundler_version = nil)
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

Expand All @@ -475,7 +475,7 @@ def lock_with(bundler_version = nil)
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

Expand All @@ -484,7 +484,7 @@ def lock_with(bundler_version = nil)
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
Expand Down
4 changes: 2 additions & 2 deletions spec/bundler/commands/install_spec.rb
Expand Up @@ -518,7 +518,7 @@
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:
Expand All @@ -544,7 +544,7 @@
source "#{file_uri_for(gem_repo1)}"
G

lockfile_should_be <<-L
expect(lockfile).to eq <<~L
GEM
remote: #{file_uri_for(gem_repo1)}/
specs:
Expand Down
6 changes: 3 additions & 3 deletions spec/bundler/commands/lock_spec.rb
Expand Up @@ -314,7 +314,7 @@ def read_lockfile(file = "Gemfile.lock")

simulate_platform(mingw) { bundle :lock }

lockfile_should_be <<-G
expect(lockfile).to eq <<~G
GEM
remote: #{file_uri_for(gem_repo4)}/
specs:
Expand All @@ -339,7 +339,7 @@ def read_lockfile(file = "Gemfile.lock")

simulate_platform(rb) { bundle :lock }

lockfile_should_be <<-G
expect(lockfile).to eq <<~G
GEM
remote: #{file_uri_for(gem_repo4)}/
specs:
Expand Down Expand Up @@ -426,7 +426,7 @@ def read_lockfile(file = "Gemfile.lock")

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:
Expand Down
6 changes: 3 additions & 3 deletions spec/bundler/commands/update_spec.rb
Expand Up @@ -939,7 +939,7 @@
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:
Expand Down Expand Up @@ -967,7 +967,7 @@
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:
Expand Down Expand Up @@ -1014,7 +1014,7 @@
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:
Expand Down
2 changes: 1 addition & 1 deletion spec/bundler/install/gemfile/install_if_spec.rb
Expand Up @@ -18,7 +18,7 @@
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:
Expand Down
8 changes: 4 additions & 4 deletions spec/bundler/install/gemfile/path_spec.rb
Expand Up @@ -552,7 +552,7 @@

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:
Expand Down Expand Up @@ -580,7 +580,7 @@

bundle "install"

lockfile_should_be <<-G
expect(lockfile).to eq <<~G
PATH
remote: #{lib_path("foo")}
specs:
Expand Down Expand Up @@ -614,7 +614,7 @@

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:
Expand Down Expand Up @@ -643,7 +643,7 @@

bundle "install"

lockfile_should_be <<-G
expect(lockfile).to eq <<~G
PATH
remote: #{lib_path("foo")}
specs:
Expand Down
22 changes: 11 additions & 11 deletions spec/bundler/install/gemfile/platform_spec.rb
Expand Up @@ -128,7 +128,7 @@
gem "pry"
G

lockfile_should_be <<-L
expect(lockfile).to eq <<~L
GEM
remote: #{file_uri_for(gem_repo4)}/
specs:
Expand Down Expand Up @@ -156,7 +156,7 @@

bundle "lock --add-platform ruby"

good_lockfile = strip_whitespace(<<-L)
good_lockfile = <<~L
GEM
remote: #{file_uri_for(gem_repo4)}/
specs:
Expand Down Expand Up @@ -186,9 +186,9 @@
#{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:
Expand Down Expand Up @@ -222,23 +222,23 @@
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

Expand Down Expand Up @@ -310,7 +310,7 @@

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:
Expand Down Expand Up @@ -447,7 +447,7 @@

expect(err).to be_empty

lockfile_should_be <<-L
expect(lockfile).to eq <<~L
GEM
remote: #{file_uri_for(gem_repo1)}/
specs:
Expand Down
2 changes: 1 addition & 1 deletion spec/bundler/install/gemfile/specific_platform_spec.rb
Expand Up @@ -87,7 +87,7 @@
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:
Expand Down
28 changes: 14 additions & 14 deletions spec/bundler/install/gems/flex_spec.rb
Expand Up @@ -259,24 +259,24 @@
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
Expand Down

0 comments on commit d0f2664

Please sign in to comment.