Sha256: 5bc3b394b940bceb24f7c2e9afca090056969ac90b6c1386e7384255c845070e

Contents?: true

Size: 499 Bytes

Versions: 2

Compression:

Stored size: 499 Bytes

Contents

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

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
activejob-lock-0.0.2 rails/actionpack/test/dispatch/rack_cache_test.rb
activejob-lock-0.0.1 rails/actionpack/test/dispatch/rack_cache_test.rb