diff options
author | José Valim <jose.valim@gmail.com> | 2011-05-17 17:32:52 -0400 |
---|---|---|
committer | José Valim <jose.valim@gmail.com> | 2011-05-17 17:33:17 -0400 |
commit | 324f1451b06c82242426b1a239b0559181b16c37 (patch) | |
tree | ddcee1d830ad340319764ffd1c2abfbb9606d81d /actionpack/test | |
parent | b77e032ccf50249685c672c2d75f173db2ee2dbf (diff) | |
download | rails-324f1451b06c82242426b1a239b0559181b16c37.tar.gz rails-324f1451b06c82242426b1a239b0559181b16c37.tar.bz2 rails-324f1451b06c82242426b1a239b0559181b16c37.zip |
Dump and load rack-cache stuff.
Diffstat (limited to 'actionpack/test')
-rw-r--r-- | actionpack/test/dispatch/rack_cache_test.rb | 21 |
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 |