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:
commit
e3a0ad83da
2 changed files with 9 additions and 1 deletions
|
@ -20,7 +20,7 @@ module Rails
|
||||||
|
|
||||||
# Set the message to be shown in logs. Uses the git repo if one is given,
|
# Set the message to be shown in logs. Uses the git repo if one is given,
|
||||||
# otherwise use name (version).
|
# otherwise use name (version).
|
||||||
parts, message = [ quote(name) ], name
|
parts, message = [ quote(name) ], name.dup
|
||||||
if version ||= options.delete(:version)
|
if version ||= options.delete(:version)
|
||||||
parts << quote(version)
|
parts << quote(version)
|
||||||
message << " (#{version})"
|
message << " (#{version})"
|
||||||
|
|
|
@ -113,6 +113,14 @@ class ActionsTest < Rails::Generators::TestCase
|
||||||
assert_file 'Gemfile', /^gem 'rspec', ">=2\.0'0"$/
|
assert_file 'Gemfile', /^gem 'rspec', ">=2\.0'0"$/
|
||||||
end
|
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
|
def test_gem_group_should_wrap_gems_in_a_group
|
||||||
run_generator
|
run_generator
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue