Methods
T
Instance Public methods
test_expand_cache_key()
# File activesupport/test/caching_test.rb, line 6
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 53
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_false()
# File activesupport/test/caching_test.rb, line 65
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 61
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 69
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 34
def test_expand_cache_key_rails_cache_id_should_win_over_rails_app_version
  begin
    ENV['RAILS_CACHE_ID'] = 'c99'
    ENV['RAILS_APP_VERSION'] = 'rails3'
    assert_equal 'c99/foo', ActiveSupport::Cache.expand_cache_key(:foo)
  ensure
    ENV['RAILS_CACHE_ID'] = nil
    ENV['RAILS_APP_VERSION'] = nil
  end
end
test_expand_cache_key_respond_to_cache_key()
# File activesupport/test/caching_test.rb, line 45
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 25
def test_expand_cache_key_with_rails_app_version
  begin
    ENV['RAILS_APP_VERSION'] = 'rails3'
    assert_equal 'rails3/foo', ActiveSupport::Cache.expand_cache_key(:foo)
  ensure
    ENV['RAILS_APP_VERSION'] = nil
  end
end
test_expand_cache_key_with_rails_cache_id()
# File activesupport/test/caching_test.rb, line 11
def test_expand_cache_key_with_rails_cache_id
  begin
    ENV['RAILS_CACHE_ID'] = 'c99'
    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)
  ensure
    ENV['RAILS_CACHE_ID'] = nil
  end
end