Methods
T
Instance Public methods
test_compress_values()
# File activesupport/test/caching_test.rb, line 1181
def test_compress_values
  value = "value" * 100
  entry = ActiveSupport::Cache::Entry.new(value, :compress => true, :compress_threshold => 1)
  assert_equal value, entry.value
  assert(value.bytesize > entry.size, "value is compressed")
end
test_expired()
# File activesupport/test/caching_test.rb, line 1171
def test_expired
  entry = ActiveSupport::Cache::Entry.new("value")
  assert !entry.expired?, 'entry not expired'
  entry = ActiveSupport::Cache::Entry.new("value", :expires_in => 60)
  assert !entry.expired?, 'entry not expired'
  Time.stub(:now, Time.now + 61) do
    assert entry.expired?, 'entry is expired'
  end
end
test_non_compress_values()
# File activesupport/test/caching_test.rb, line 1188
def test_non_compress_values
  value = "value" * 100
  entry = ActiveSupport::Cache::Entry.new(value)
  assert_equal value, entry.value
  assert_equal value.bytesize, entry.size
end