Methods
N
T
Class Public methods
new(value, options = {})
# File activesupport/test/caching_test.rb, line 45
def initialize(value, options = {})
  @value = value
  @expires_in = nil
  @created_at = nil
  super
end
Instance Public methods
test_entry_legacy_optional_ivars()
# File activesupport/test/caching_test.rb, line 43
def test_entry_legacy_optional_ivars
  legacy = Class.new(ActiveSupport::Cache::Entry) do
    def initialize(value, options = {})
      @value = value
      @expires_in = nil
      @created_at = nil
      super
    end
  end

  entry = legacy.new 'foo'
  assert_equal 'foo', entry.value
end
test_expand_cache_key()
# File activesupport/test/caching_test.rb, line 57
def test_expand_cache_key
  assert_equal '1/2/true', ActiveSupport::Cache.expand_cache_key([1, '2', true])
  assert_equal 'name/1/2/true', ActiveSupport::Cache.expand_cache_key([1, '2', true], :name)
end
test_expand_cache_key_array_with_something_that_responds_to_cache_key()
# File activesupport/test/caching_test.rb, line 93
def test_expand_cache_key_array_with_something_that_responds_to_cache_key
  key = 'foo'
  def key.cache_key
    :foo_key
  end
  assert_equal 'foo_key', ActiveSupport::Cache.expand_cache_key([key])
end
test_expand_cache_key_of_array_like_object()
# File activesupport/test/caching_test.rb, line 113
def test_expand_cache_key_of_array_like_object
  assert_equal 'foo/bar/baz', ActiveSupport::Cache.expand_cache_key(%w{foo bar baz}.to_enum)
end
test_expand_cache_key_of_false()
# File activesupport/test/caching_test.rb, line 105
def test_expand_cache_key_of_false
  assert_equal 'false', ActiveSupport::Cache.expand_cache_key(false)
end
test_expand_cache_key_of_nil()
# File activesupport/test/caching_test.rb, line 101
def test_expand_cache_key_of_nil
  assert_equal '', ActiveSupport::Cache.expand_cache_key(nil)
end
test_expand_cache_key_of_true()
# File activesupport/test/caching_test.rb, line 109
def test_expand_cache_key_of_true
  assert_equal 'true', ActiveSupport::Cache.expand_cache_key(true)
end
test_expand_cache_key_rails_cache_id_should_win_over_rails_app_version()
# File activesupport/test/caching_test.rb, line 79
def test_expand_cache_key_rails_cache_id_should_win_over_rails_app_version
  with_env('RAILS_CACHE_ID' => 'c99', 'RAILS_APP_VERSION' => 'rails3') do
    assert_equal 'c99/foo', ActiveSupport::Cache.expand_cache_key(:foo)
  end
end
test_expand_cache_key_respond_to_cache_key()
# File activesupport/test/caching_test.rb, line 85
def test_expand_cache_key_respond_to_cache_key
  key = 'foo'
  def key.cache_key
    :foo_key
  end
  assert_equal 'foo_key', ActiveSupport::Cache.expand_cache_key(key)
end
test_expand_cache_key_with_rails_app_version()
# File activesupport/test/caching_test.rb, line 73
def test_expand_cache_key_with_rails_app_version
  with_env('RAILS_APP_VERSION' => 'rails3') do
    assert_equal 'rails3/foo', ActiveSupport::Cache.expand_cache_key(:foo)
  end
end
test_expand_cache_key_with_rails_cache_id()
# File activesupport/test/caching_test.rb, line 62
def test_expand_cache_key_with_rails_cache_id
  with_env('RAILS_CACHE_ID' => 'c99') do
    assert_equal 'c99/foo', ActiveSupport::Cache.expand_cache_key(:foo)
    assert_equal 'c99/foo', ActiveSupport::Cache.expand_cache_key([:foo])
    assert_equal 'c99/foo/bar', ActiveSupport::Cache.expand_cache_key([:foo, :bar])
    assert_equal 'nm/c99/foo', ActiveSupport::Cache.expand_cache_key(:foo, :nm)
    assert_equal 'nm/c99/foo', ActiveSupport::Cache.expand_cache_key([:foo], :nm)
    assert_equal 'nm/c99/foo/bar', ActiveSupport::Cache.expand_cache_key([:foo, :bar], :nm)
  end
end