diff options
Diffstat (limited to 'activesupport')
-rw-r--r-- | activesupport/lib/active_support/cache.rb | 2 | ||||
-rw-r--r-- | activesupport/test/caching_test.rb | 6 |
2 files changed, 4 insertions, 4 deletions
diff --git a/activesupport/lib/active_support/cache.rb b/activesupport/lib/active_support/cache.rb index 97583c9bd9..2bf24558a6 100644 --- a/activesupport/lib/active_support/cache.rb +++ b/activesupport/lib/active_support/cache.rb @@ -542,7 +542,7 @@ module ActiveSupport entry = new(nil) entry.instance_variable_set(:@value, raw_value) entry.instance_variable_set(:@created_at, created_at.to_f) - entry.instance_variable_set(:@compressed, !!options[:compressed]) + entry.instance_variable_set(:@compressed, options[:compressed]) entry.instance_variable_set(:@expires_in, options[:expires_in]) entry end diff --git a/activesupport/test/caching_test.rb b/activesupport/test/caching_test.rb index cb5362525f..29bc4d8ec6 100644 --- a/activesupport/test/caching_test.rb +++ b/activesupport/test/caching_test.rb @@ -723,7 +723,7 @@ class CacheEntryTest < ActiveSupport::TestCase entry = ActiveSupport::Cache::Entry.create("raw", time, :compress => false, :expires_in => 300) assert_equal "raw", entry.raw_value assert_equal time.to_f, entry.created_at - assert_equal false, entry.compressed? + assert !entry.compressed? assert_equal 300, entry.expires_in end @@ -740,7 +740,7 @@ class CacheEntryTest < ActiveSupport::TestCase def test_compress_values entry = ActiveSupport::Cache::Entry.new("value", :compress => true, :compress_threshold => 1) assert_equal "value", entry.value - assert_equal true, entry.compressed? + assert entry.compressed? assert_equal "value", Marshal.load(Zlib::Inflate.inflate(entry.raw_value)) end @@ -748,6 +748,6 @@ class CacheEntryTest < ActiveSupport::TestCase entry = ActiveSupport::Cache::Entry.new("value") assert_equal "value", entry.value assert_equal "value", Marshal.load(entry.raw_value) - assert_equal false, entry.compressed? + assert !entry.compressed? end end |