From 324f1451b06c82242426b1a239b0559181b16c37 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Valim?= Date: Tue, 17 May 2011 17:32:52 -0400 Subject: Dump and load rack-cache stuff. --- actionpack/test/dispatch/rack_cache_test.rb | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 actionpack/test/dispatch/rack_cache_test.rb (limited to 'actionpack/test/dispatch') 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 -- cgit v1.2.3