Permalink
Browse files

Merge pull request #7812 from bdurand/optimize_cache_entry_take_2

fix broken cache tests
  • Loading branch information...
2 parents 34239cc + b784900 commit 15125e092c2adc33dbec9005ae82a70fcae82572 @jeremy jeremy committed Oct 1, 2012
Showing with 3 additions and 3 deletions.
  1. +2 −2 activesupport/lib/active_support/cache.rb
  2. +1 −1 activesupport/test/caching_test.rb
@@ -591,9 +591,9 @@ def size
when NilClass
0
when String
- value.bytesize
+ @v.bytesize
else
- @s = Marshal.dump(value).bytesize
+ @s = Marshal.dump(@v).bytesize
end
end
end
@@ -616,7 +616,7 @@ def test_log_exception_when_cache_read_fails
class MemoryStoreTest < ActiveSupport::TestCase
def setup
- @record_size = Marshal.dump("aaaaaaaaaa").bytesize
+ @record_size = ActiveSupport::Cache::Entry.new("aaaaaaaaaa").size
@cache = ActiveSupport::Cache.lookup_store(:memory_store, :expires_in => 60, :size => @record_size * 10)
end

0 comments on commit 15125e0

Please sign in to comment.