diff options
Diffstat (limited to 'activesupport/test')
-rw-r--r-- | activesupport/test/memoizable_test.rb | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/activesupport/test/memoizable_test.rb b/activesupport/test/memoizable_test.rb index 33f1e7fe61..069ae27eb2 100644 --- a/activesupport/test/memoizable_test.rb +++ b/activesupport/test/memoizable_test.rb @@ -128,6 +128,16 @@ class MemoizableTest < Test::Unit::TestCase assert_equal 3, @calculator.counter end + def test_flush_cache + assert_equal 1, @calculator.counter + + assert @calculator.instance_variable_get(:@_memoized_counter).any? + @calculator.flush_cache(:counter) + assert @calculator.instance_variable_get(:@_memoized_counter).empty? + + assert_equal 2, @calculator.counter + end + def test_unmemoize_all assert_equal 1, @calculator.counter |