aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/dispatch/rack_cache_test.rb
diff options
context:
space:
mode:
Diffstat (limited to 'actionpack/test/dispatch/rack_cache_test.rb')
-rw-r--r--actionpack/test/dispatch/rack_cache_test.rb21
1 files changed, 21 insertions, 0 deletions
diff --git a/actionpack/test/dispatch/rack_cache_test.rb b/actionpack/test/dispatch/rack_cache_test.rb
new file mode 100644
index 0000000000..79d8a64d29
--- /dev/null
+++ b/actionpack/test/dispatch/rack_cache_test.rb
@@ -0,0 +1,21 @@
+require 'abstract_unit'
+require 'action_dispatch/http/rack_cache'
+
+class RackCacheMetaStoreTest < ActiveSupport::TestCase
+ class ReadWriteHash < ::Hash
+ alias :read :[]
+ alias :write :[]=
+ end
+
+ setup do
+ @store = ActionDispatch::RailsMetaStore.new(ReadWriteHash.new)
+ end
+
+ test "stuff is deep duped" do
+ @store.write(:foo, { :bar => :original })
+ hash = @store.read(:foo)
+ hash[:bar] = :changed
+ hash = @store.read(:foo)
+ assert_equal :original, hash[:bar]
+ end
+end