[前][次][番号順一覧][スレッド一覧]

ruby-changes:69712

From: David <ko1@a...>
Date: Fri, 12 Nov 2021 06:05:23 +0900 (JST)
Subject: [ruby-changes:69712] d0f266460f (master): [rubygems/rubygems] Remove `lockfile_should_be` helper

https://git.ruby-lang.org/ruby.git/commit/?id=d0f266460f

From d0f266460f982137e24af2fbf3f7eeaaa8d47210 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?David=20Rodr=C3=ADguez?= <deivid.rodriguez@r...>
Date: Thu, 11 Nov 2021 20:24:02 +0100
Subject: [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 +-
 spec/bundler/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 728945c4019..2618786e7ce 100644
--- a/spec/bundler/bundler/definition_spec.rb
+++ b/spec/bundler/bundler/definition_spec.rb
@@ -59,7 +59,7 @@ RSpec.describe Bundler::Definition do https://github.com/ruby/ruby/blob/trunk/spec/bundler/bundler/definition_spec.rb#L59
       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 https://github.com/ruby/ruby/blob/trunk/spec/bundler/bundler/definition_spec.rb#L96
       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 https://github.com/ruby/ruby/blob/trunk/spec/bundler/bundler/definition_spec.rb#L129
       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 https://github.com/ruby/ruby/blob/trunk/spec/bundler/bundler/definition_spec.rb#L155
       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 419deae19ba..1fa35136eb8 100644
--- a/spec/bundler/commands/check_spec.rb
+++ b/spec/bundler/commands/check_spec.rb
@@ -433,7 +433,7 @@ RSpec.describe "bundle check" do https://github.com/ruby/ruby/blob/trunk/spec/bundler/commands/check_spec.rb#L433
 
   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 https://github.com/ruby/ruby/blob/trunk/spec/bundler/commands/check_spec.rb#L447
       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 https://github.com/ruby/ruby/blob/trunk/spec/bundler/commands/check_spec.rb#L466
       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 https://github.com/ruby/ruby/blob/trunk/spec/bundler/commands/check_spec.rb#L475
         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 https://github.com/ruby/ruby/blob/trunk/spec/bundler/commands/check_spec.rb#L484
         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 2c7f0360e6c..e00caa53153 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 https://github.com/ruby/ruby/blob/trunk/spec/bundler/commands/install_spec.rb#L518
       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 https://github.com/ruby/ruby/blob/trunk/spec/bundler/commands/install_spec.rb#L544
           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 171ec1ba1da..22709f45286 100644
--- a/spec/bundler/commands/lock_spec.rb
+++ b/spec/bundler/commands/lock_spec.rb
@@ -314,7 +314,7 @@ RSpec.describe "bundle lock" do https://github.com/ruby/ruby/blob/trunk/spec/bundler/commands/lock_spec.rb#L314
 
     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 https://github.com/ruby/ruby/blob/trunk/spec/bundler/commands/lock_spec.rb#L339
 
     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 https://github.com/ruby/ruby/blob/trunk/spec/bundler/commands/lock_spec.rb#L426
 
     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 14fe3e245b9..c8f084ca0e0 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 https://github.com/ruby/ruby/blob/trunk/spec/bundler/commands/update_spec.rb#L939
     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 https://github.com/ruby/ruby/blob/trunk/spec/bundler/commands/update_spec.rb#L967
     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 https://github.com/ruby/ruby/blob/trunk/spec/bundler/commands/update_spec.rb#L1014
     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 786e0e92584..3d2d15a698c 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 https://github.com/ruby/ruby/blob/trunk/spec/bundler/install/gemfile/install_if_spec.rb#L18
     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 566fdcf65a1..539fe242851 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 https://github.com/ruby/ruby/blob/trunk/spec/bundler/install/gemfile/path_spec.rb#L552
 
       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.d (... truncated)

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]