From 1f5df415a150a70df161971a61c7e1486828d017 Mon Sep 17 00:00:00 2001 From: Yasuo Honda Date: Mon, 30 Sep 2024 21:08:32 +0900 Subject: [PATCH] Use `Gem.ruby_version` in `test_inclusion_of_ruby_version` test Rails main branch requires Ruby 3.2.0 that ships RubyGems 3.4.1 that is higher than 3.3.3, so we can use `Gem.ruby_version` in `test_inclusion_of_ruby_version` test. As per commented at https://github.com/rails/rails/pull/53072#issuecomment-2379977746 Co-authored-by: Earlopain <14981592+Earlopain@users.noreply.github.com> --- railties/test/generators/app_generator_test.rb | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/railties/test/generators/app_generator_test.rb b/railties/test/generators/app_generator_test.rb index 7d16a7f17db95..2b5e07ff62ec5 100644 --- a/railties/test/generators/app_generator_test.rb +++ b/railties/test/generators/app_generator_test.rb @@ -1028,10 +1028,8 @@ def test_bootsnap_with_dev_option def test_inclusion_of_ruby_version run_generator - ruby_version = "#{Gem::Version.new(Gem::VERSION) >= Gem::Version.new("3.3.13") ? Gem.ruby_version : RUBY_VERSION}" - assert_file "Dockerfile" do |content| - assert_match(/ARG RUBY_VERSION=#{ruby_version}/, content) + assert_match(/ARG RUBY_VERSION=#{Gem.ruby_version}/, content) end assert_file ".ruby-version" do |content| if ENV["RBENV_VERSION"]