[rubygems/rubygems] Extract a next_ruby_minor helper method for specs

https://github.com/rubygems/rubygems/commit/66eae0ef1d
This commit is contained in:
David Rodríguez 2022-04-01 09:23:09 +02:00 committed by git
parent a85cdb5a6e
commit 54b1548760
2 changed files with 8 additions and 6 deletions

View File

@ -493,27 +493,25 @@ RSpec.describe "bundle lock" do
end end
it "does not conflict on ruby requirements when adding new platforms" do 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_repo4 do
build_gem "raygun-apm", "1.0.78" do |s| build_gem "raygun-apm", "1.0.78" do |s|
s.platform = "x86_64-linux" s.platform = "x86_64-linux"
s.required_ruby_version = "< #{next_minor}.dev" s.required_ruby_version = "< #{next_ruby_minor}.dev"
end end
build_gem "raygun-apm", "1.0.78" do |s| build_gem "raygun-apm", "1.0.78" do |s|
s.platform = "universal-darwin" s.platform = "universal-darwin"
s.required_ruby_version = "< #{next_minor}.dev" s.required_ruby_version = "< #{next_ruby_minor}.dev"
end end
build_gem "raygun-apm", "1.0.78" do |s| build_gem "raygun-apm", "1.0.78" do |s|
s.platform = "x64-mingw32" s.platform = "x64-mingw32"
s.required_ruby_version = "< #{next_minor}.dev" s.required_ruby_version = "< #{next_ruby_minor}.dev"
end end
build_gem "raygun-apm", "1.0.78" do |s| build_gem "raygun-apm", "1.0.78" do |s|
s.platform = "x64-mingw-ucrt" s.platform = "x64-mingw-ucrt"
s.required_ruby_version = "< #{next_minor}.dev" s.required_ruby_version = "< #{next_ruby_minor}.dev"
end end
end end

View File

@ -471,6 +471,10 @@ module Spec
end end
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 # versions providing a bundler version finder but not including
# https://github.com/rubygems/rubygems/commit/929e92d752baad3a08f3ac92eaec162cb96aedd1 # https://github.com/rubygems/rubygems/commit/929e92d752baad3a08f3ac92eaec162cb96aedd1
def rubygems_version_failing_to_activate_bundler_prereleases def rubygems_version_failing_to_activate_bundler_prereleases