aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/test/memoizable_test.rb
diff options
context:
space:
mode:
Diffstat (limited to 'activesupport/test/memoizable_test.rb')
-rw-r--r--activesupport/test/memoizable_test.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/activesupport/test/memoizable_test.rb b/activesupport/test/memoizable_test.rb
index 99d9240ea1..135d56f14a 100644
--- a/activesupport/test/memoizable_test.rb
+++ b/activesupport/test/memoizable_test.rb
@@ -110,6 +110,11 @@ uses_mocha 'Memoizable' do
assert_equal 1, @person.age_calls
end
+ def test_memorized_results_are_immutable
+ assert_equal "Josh", @person.name
+ assert_raise(ActiveSupport::FrozenObjectError) { @person.name.gsub!("Josh", "Gosh") }
+ end
+
def test_reloadable
counter = @calculator.counter
assert_equal 1, @calculator.counter