1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Merge pull request #33152 from bogdanvlviv/fix-ruby-version-file

Fix Ruby version in `.ruby-version`
This commit is contained in:
Rafael França 2018-06-18 17:01:19 -04:00 committed by GitHub
commit 433a312269
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 2 deletions

View file

@ -1 +1 @@
<%= "#{RUBY_ENGINE}-#{RUBY_ENGINE_VERSION}" -%>
<%= ENV["RBENV_VERSION"] || ENV["rvm_ruby_string"] || "#{RUBY_ENGINE}-#{RUBY_ENGINE_VERSION}" -%>

View file

@ -891,7 +891,13 @@ class AppGeneratorTest < Rails::Generators::TestCase
assert_match(/ruby '#{RUBY_VERSION}'/, content)
end
assert_file ".ruby-version" do |content|
assert_match(/#{RUBY_ENGINE}-#{RUBY_ENGINE_VERSION}/, content)
if ENV["RBENV_VERSION"]
assert_match(/#{ENV["RBENV_VERSION"]}/, content)
elsif ENV["rvm_ruby_string"]
assert_match(/#{ENV["rvm_ruby_string"]}/, content)
else
assert_match(/#{RUBY_ENGINE}-#{RUBY_ENGINE_VERSION}/, content)
end
end
end