You need to start a memcached server inorder to run these tests

Namespace
Methods
S
T
Included Modules
Constants
MEMCACHE_UP = true
 
Instance Public methods
setup()
# File activesupport/test/caching_test.rb, line 1020
def setup
  skip "memcache server is not up" unless MEMCACHE_UP

  @cache = ActiveSupport::Cache.lookup_store(:mem_cache_store, :expires_in => 60)
  @peek = ActiveSupport::Cache.lookup_store(:mem_cache_store)
  @data = @cache.instance_variable_get(:@data)
  @cache.clear
  @cache.silence!
  @cache.logger = ActiveSupport::Logger.new("/dev/null")
end
test_can_call_deprecated_escape_key()
# File activesupport/test/caching_test.rb, line 1077
def test_can_call_deprecated_escape_key
  assert_deprecated "`escape_key` is deprecated" do
    assert_equal 111, @cache.send(:escape_key, 111)
  end
end
test_deserializes_unloaded_class()
# File actionpack/test/dispatch/session/mem_cache_store_test.rb, line 136
def test_deserializes_unloaded_class
  with_test_route_set do
    with_autoload_path "session_autoload_test" do
      get '/set_serialized_session_value'
      assert_response :success
      assert cookies['_session_id']
    end
    with_autoload_path "session_autoload_test" do
      get '/get_session_id'
      assert_response :success
    end
  end
rescue Dalli::RingError => ex
  skip ex.message, ex.backtrace
end
test_getting_from_nonexistent_session()
# File actionpack/test/dispatch/session/mem_cache_store_test.rb, line 87
def test_getting_from_nonexistent_session
  with_test_route_set do
    get '/get_session_value'
    assert_response :success
    assert_equal 'foo: nil', response.body
    assert_nil cookies['_session_id'], "should only create session on write, not read"
  end
rescue Dalli::RingError => ex
  skip ex.message, ex.backtrace
end
test_getting_nil_session_value()
# File actionpack/test/dispatch/session/mem_cache_store_test.rb, line 56
def test_getting_nil_session_value
  with_test_route_set do
    get '/get_session_value'
    assert_response :success
    assert_equal 'foo: nil', response.body
  end
rescue Dalli::RingError => ex
  skip ex.message, ex.backtrace
end
test_getting_session_id()
# File actionpack/test/dispatch/session/mem_cache_store_test.rb, line 121
def test_getting_session_id
  with_test_route_set do
    get '/set_session_value'
    assert_response :success
    assert cookies['_session_id']
    session_id = cookies['_session_id']

    get '/get_session_id'
    assert_response :success
    assert_equal session_id, response.body, "should be able to read session id without accessing the session hash"
  end
rescue Dalli::RingError => ex
  skip ex.message, ex.backtrace
end
test_getting_session_value_after_session_reset()
# File actionpack/test/dispatch/session/mem_cache_store_test.rb, line 66
def test_getting_session_value_after_session_reset
  with_test_route_set do
    get '/set_session_value'
    assert_response :success
    assert cookies['_session_id']
    session_cookie = cookies.send(:hash_for)['_session_id']

    get '/call_reset_session'
    assert_response :success
    assert_not_equal [], headers['Set-Cookie']

    cookies << session_cookie # replace our new session_id with our old, pre-reset session_id

    get '/get_session_value'
    assert_response :success
    assert_equal 'foo: nil', response.body, "data for this session should have been obliterated from memcached"
  end
rescue Dalli::RingError => ex
  skip ex.message, ex.backtrace
end
test_local_cache_raw_values()
# File activesupport/test/caching_test.rb, line 1051
def test_local_cache_raw_values
  cache = ActiveSupport::Cache.lookup_store(:mem_cache_store, :raw => true)
  cache.clear
  cache.with_local_cache do
    cache.write("foo", 2)
    assert_equal "2", cache.read("foo")
  end
end
test_local_cache_raw_values_with_marshal()
# File activesupport/test/caching_test.rb, line 1060
def test_local_cache_raw_values_with_marshal
  cache = ActiveSupport::Cache.lookup_store(:mem_cache_store, :raw => true)
  cache.clear
  cache.with_local_cache do
    cache.write("foo", Marshal.dump([]))
    assert_equal [], cache.read("foo")
  end
end
test_prevents_session_fixation()
# File actionpack/test/dispatch/session/mem_cache_store_test.rb, line 166
def test_prevents_session_fixation
  with_test_route_set do
    get '/get_session_value'
    assert_response :success
    assert_equal 'foo: nil', response.body
    session_id = cookies['_session_id']

    reset!

    get '/set_session_value', params: { _session_id: session_id }
    assert_response :success
    assert_not_equal session_id, cookies['_session_id']
  end
rescue Dalli::RingError => ex
  skip ex.message, ex.backtrace
end
test_raw_values()
# File activesupport/test/caching_test.rb, line 1037
def test_raw_values
  cache = ActiveSupport::Cache.lookup_store(:mem_cache_store, :raw => true)
  cache.clear
  cache.write("foo", 2)
  assert_equal "2", cache.read("foo")
end
test_raw_values_with_marshal()
# File activesupport/test/caching_test.rb, line 1044
def test_raw_values_with_marshal
  cache = ActiveSupport::Cache.lookup_store(:mem_cache_store, :raw => true)
  cache.clear
  cache.write("foo", Marshal.dump([]))
  assert_equal [], cache.read("foo")
end
test_read_should_return_a_different_object_id_each_time_it_is_called()
# File activesupport/test/caching_test.rb, line 1069
def test_read_should_return_a_different_object_id_each_time_it_is_called
  @cache.write('foo', 'bar')
  value = @cache.read('foo')
  assert_not_equal value.object_id, @cache.read('foo').object_id
  value << 'bingo'
  assert_not_equal value, @cache.read('foo')
end
test_setting_and_getting_session_value()
# File actionpack/test/dispatch/session/mem_cache_store_test.rb, line 42
def test_setting_and_getting_session_value
  with_test_route_set do
    get '/set_session_value'
    assert_response :success
    assert cookies['_session_id']

    get '/get_session_value'
    assert_response :success
    assert_equal 'foo: "bar"', response.body
  end
rescue Dalli::RingError => ex
  skip ex.message, ex.backtrace
end
test_setting_session_value_after_session_reset()
# File actionpack/test/dispatch/session/mem_cache_store_test.rb, line 98
def test_setting_session_value_after_session_reset
  with_test_route_set do
    get '/set_session_value'
    assert_response :success
    assert cookies['_session_id']
    session_id = cookies['_session_id']

    get '/call_reset_session'
    assert_response :success
    assert_not_equal [], headers['Set-Cookie']

    get '/get_session_value'
    assert_response :success
    assert_equal 'foo: nil', response.body

    get '/get_session_id'
    assert_response :success
    assert_not_equal session_id, response.body
  end
rescue Dalli::RingError => ex
  skip ex.message, ex.backtrace
end