aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/test
diff options
context:
space:
mode:
authorJoshua Peek <josh@joshpeek.com>2008-08-19 19:20:10 -0500
committerJoshua Peek <josh@joshpeek.com>2008-08-19 19:20:10 -0500
commit5de340e79f1d11973b7c7bbec82f320fc92b9c99 (patch)
tree71673fecc53a7904629424522feafaaca933f2c2 /activesupport/test
parenta8ece12fe2ac7838407954453e0d31af6186a5db (diff)
downloadrails-5de340e79f1d11973b7c7bbec82f320fc92b9c99.tar.gz
rails-5de340e79f1d11973b7c7bbec82f320fc92b9c99.tar.bz2
rails-5de340e79f1d11973b7c7bbec82f320fc92b9c99.zip
Ensure objects cached with MemoryStore are immutable
Diffstat (limited to 'activesupport/test')
-rw-r--r--activesupport/test/caching_test.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/activesupport/test/caching_test.rb b/activesupport/test/caching_test.rb
index ce27b464f8..9ea9389448 100644
--- a/activesupport/test/caching_test.rb
+++ b/activesupport/test/caching_test.rb
@@ -120,4 +120,10 @@ class MemoryStoreTest < Test::Unit::TestCase
def test_fetch_with_forced_cache_miss
@cache.fetch('foo', :force => true) { 'bar' }
end
+
+ def test_store_objects_should_be_immutable
+ @cache.write('foo', 'bar')
+ assert_raise(ActiveSupport::FrozenObjectError) { @cache.read('foo').gsub!(/.*/, 'baz') }
+ assert_equal 'bar', @cache.read('foo')
+ end
end