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

ruby-changes:71791

From: David <ko1@a...>
Date: Wed, 11 May 2022 16:56:05 +0900 (JST)
Subject: [ruby-changes:71791] 54b1548760 (master): [rubygems/rubygems] Extract a `next_ruby_minor` helper method for specs

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

From 54b1548760d3a159051247313256175904c6f36e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?David=20Rodr=C3=ADguez?= <deivid.rodriguez@r...>
Date: Fri, 1 Apr 2022 09:23:09 +0200
Subject: [rubygems/rubygems] Extract a `next_ruby_minor` helper method for
 specs

https://github.com/rubygems/rubygems/commit/66eae0ef1d
---
 spec/bundler/commands/lock_spec.rb | 10 ++++------
 spec/bundler/support/helpers.rb    |  4 ++++
 2 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/spec/bundler/commands/lock_spec.rb b/spec/bundler/commands/lock_spec.rb
index 9c5240157f..11f96315ca 100644
--- a/spec/bundler/commands/lock_spec.rb
+++ b/spec/bundler/commands/lock_spec.rb
@@ -493,27 +493,25 @@ RSpec.describe "bundle lock" do https://github.com/ruby/ruby/blob/trunk/spec/bundler/commands/lock_spec.rb#L493
   end
 
   it "does not conflict on ruby requirements when adding new platforms" do
-    next_minor = Gem.ruby_version.segments[0..1].map.with_index {|s, i| i == 1 ? s + 1 : s }.join(".")
-
     build_repo4 do
       build_gem "raygun-apm", "1.0.78" do |s|
         s.platform = "x86_64-linux"
-        s.required_ruby_version = "< #{next_minor}.dev"
+        s.required_ruby_version = "< #{next_ruby_minor}.dev"
       end
 
       build_gem "raygun-apm", "1.0.78" do |s|
         s.platform = "universal-darwin"
-        s.required_ruby_version = "< #{next_minor}.dev"
+        s.required_ruby_version = "< #{next_ruby_minor}.dev"
       end
 
       build_gem "raygun-apm", "1.0.78" do |s|
         s.platform = "x64-mingw32"
-        s.required_ruby_version = "< #{next_minor}.dev"
+        s.required_ruby_version = "< #{next_ruby_minor}.dev"
       end
 
       build_gem "raygun-apm", "1.0.78" do |s|
         s.platform = "x64-mingw-ucrt"
-        s.required_ruby_version = "< #{next_minor}.dev"
+        s.required_ruby_version = "< #{next_ruby_minor}.dev"
       end
     end
 
diff --git a/spec/bundler/support/helpers.rb b/spec/bundler/support/helpers.rb
index d7556102b4..ab6a0625bb 100644
--- a/spec/bundler/support/helpers.rb
+++ b/spec/bundler/support/helpers.rb
@@ -471,6 +471,10 @@ module Spec https://github.com/ruby/ruby/blob/trunk/spec/bundler/support/helpers.rb#L471
       end
     end
 
+    def next_ruby_minor
+      Gem.ruby_version.segments[0..1].map.with_index {|s, i| i == 1 ? s + 1 : s }.join(".")
+    end
+
     # versions providing a bundler version finder but not including
     # https://github.com/rubygems/rubygems/commit/929e92d752baad3a08f3ac92eaec162cb96aedd1
     def rubygems_version_failing_to_activate_bundler_prereleases
-- 
cgit v1.2.1


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

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