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

These strings should already be frozen where ruby accepts the magic-comment

This commit is contained in:
Akira Matsuda 2017-11-14 17:15:33 +09:00
parent 6c27341fbc
commit 23c41e4657

View file

@ -19,7 +19,7 @@ class ObjectInstanceVariableTest < ActiveSupport::TestCase
end
def test_instance_exec_passes_arguments_to_block
assert_equal %w(hello goodbye), "hello".instance_exec("goodbye") { |v| [self, v] }
assert_equal %w(hello goodbye), "hello".dup.instance_exec("goodbye") { |v| [self, v] }
end
def test_instance_exec_with_frozen_obj
@ -27,7 +27,7 @@ class ObjectInstanceVariableTest < ActiveSupport::TestCase
end
def test_instance_exec_nested
assert_equal %w(goodbye olleh bar), "hello".instance_exec("goodbye") { |arg|
assert_equal %w(goodbye olleh bar), "hello".dup.instance_exec("goodbye") { |arg|
[arg] + instance_exec("bar") { |v| [reverse, v] } }
end
end