Skip to content

Commit

Permalink
Use Gem.ruby_version in test_inclusion_of_ruby_version test
Browse files Browse the repository at this point in the history
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 rails#53072 (comment)

Co-authored-by: Earlopain <[email protected]>
  • Loading branch information
yahonda and Earlopain committed Sep 30, 2024
1 parent ebd9bee commit 1299727
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions railties/test/generators/app_generator_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
Expand Down

0 comments on commit 1299727

Please sign in to comment.