diff options
author | Pat Allan <pat@freelancing-gods.com> | 2017-06-20 18:35:44 +1000 |
---|---|---|
committer | Pat Allan <pat@freelancing-gods.com> | 2017-06-20 18:35:44 +1000 |
commit | 4ff30d9bb6d5d591fbb3952112d721c995059302 (patch) | |
tree | b5f7e2b6a690bceecc0fce3990247b08dda1a268 /activemodel/test | |
parent | 036bdee4d5bdad3b3fa1d57ca292214afe746a09 (diff) | |
download | rails-4ff30d9bb6d5d591fbb3952112d721c995059302.tar.gz rails-4ff30d9bb6d5d591fbb3952112d721c995059302.tar.bz2 rails-4ff30d9bb6d5d591fbb3952112d721c995059302.zip |
Make ActiveModel frozen string literal friendly.
Includes two external changes because they're referenced within the ActiveModel test suite.
Diffstat (limited to 'activemodel/test')
-rw-r--r-- | activemodel/test/cases/dirty_test.rb | 2 | ||||
-rw-r--r-- | activemodel/test/cases/type/string_test.rb | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/activemodel/test/cases/dirty_test.rb b/activemodel/test/cases/dirty_test.rb index fdd18d7601..0242b96083 100644 --- a/activemodel/test/cases/dirty_test.rb +++ b/activemodel/test/cases/dirty_test.rb @@ -96,7 +96,7 @@ class DirtyTest < ActiveModel::TestCase end test "attribute mutation" do - @model.instance_variable_set("@name", "Yam") + @model.instance_variable_set("@name", "Yam".dup) assert !@model.name_changed? @model.name.replace("Hadad") assert !@model.name_changed? diff --git a/activemodel/test/cases/type/string_test.rb b/activemodel/test/cases/type/string_test.rb index 47d412e27e..5bf9fc3527 100644 --- a/activemodel/test/cases/type/string_test.rb +++ b/activemodel/test/cases/type/string_test.rb @@ -14,7 +14,7 @@ module ActiveModel test "cast strings are mutable" do type = Type::String.new - s = "foo" + s = "foo".dup assert_equal false, type.cast(s).frozen? assert_equal false, s.frozen? |