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

Merge pull request #23216 from prathamesh-sonpatki/fix-23137

Rails::Generators::Actions#gem should work even if frozen string is passed as argument
This commit is contained in:
Matthew Draper 2016-01-24 16:38:58 +10:30
commit e3a0ad83da
2 changed files with 9 additions and 1 deletions

View file

@ -20,7 +20,7 @@ module Rails
# Set the message to be shown in logs. Uses the git repo if one is given,
# otherwise use name (version).
parts, message = [ quote(name) ], name
parts, message = [ quote(name) ], name.dup
if version ||= options.delete(:version)
parts << quote(version)
message << " (#{version})"

View file

@ -113,6 +113,14 @@ class ActionsTest < Rails::Generators::TestCase
assert_file 'Gemfile', /^gem 'rspec', ">=2\.0'0"$/
end
def test_gem_works_even_if_frozen_string_is_passed_as_argument
run_generator
action :gem, "frozen_gem".freeze, "1.0.0".freeze
assert_file 'Gemfile', /^gem 'frozen_gem', '1.0.0'$/
end
def test_gem_group_should_wrap_gems_in_a_group
run_generator