Methods
T
Instance Public methods
test_can_call_deprecated_set_cache_value()
# File activesupport/test/caching_test.rb, line 721
def test_can_call_deprecated_set_cache_value
  @cache.with_local_cache do
    assert_deprecated "`set_cache_value` is deprecated" do
      @cache.send(:set_cache_value, 1, 'foo', :ignored, {})
    end
    assert_equal 1, @cache.read('foo')
  end
end
test_clear_also_clears_local_cache()
# File activesupport/test/caching_test.rb, line 627
def test_clear_also_clears_local_cache
  @cache.with_local_cache do
    @cache.write('foo', 'bar')
    @cache.clear
    assert_nil @cache.read('foo')
  end

  assert_nil @cache.read('foo')
end
test_local_cache_fetch()
# File activesupport/test/caching_test.rb, line 660
def test_local_cache_fetch
  @cache.with_local_cache do
    @cache.send(:local_cache).write 'foo', 'bar'
    assert_equal 'bar', @cache.send(:local_cache).fetch('foo')
  end
end
test_local_cache_of_decrement()
# File activesupport/test/caching_test.rb, line 701
def test_local_cache_of_decrement
  @cache.with_local_cache do
    @cache.write('foo', 1, :raw => true)
    @peek.write('foo', 3, :raw => true)
    @cache.decrement('foo')
    assert_equal 2, @cache.read('foo')
  end
end
test_local_cache_of_delete()
# File activesupport/test/caching_test.rb, line 676
def test_local_cache_of_delete
  @cache.with_local_cache do
    @cache.write('foo', 'bar')
    @cache.delete('foo')
    assert_nil @cache.read('foo')
  end
end
test_local_cache_of_exist()
# File activesupport/test/caching_test.rb, line 684
def test_local_cache_of_exist
  @cache.with_local_cache do
    @cache.write('foo', 'bar')
    @peek.delete('foo')
    assert @cache.exist?('foo')
  end
end
test_local_cache_of_increment()
# File activesupport/test/caching_test.rb, line 692
def test_local_cache_of_increment
  @cache.with_local_cache do
    @cache.write('foo', 1, :raw => true)
    @peek.write('foo', 2, :raw => true)
    @cache.increment('foo')
    assert_equal 3, @cache.read('foo')
  end
end
test_local_cache_of_read()
# File activesupport/test/caching_test.rb, line 645
def test_local_cache_of_read
  @cache.write('foo', 'bar')
  @cache.with_local_cache do
    assert_equal 'bar', @cache.read('foo')
  end
end
test_local_cache_of_read_nil()
# File activesupport/test/caching_test.rb, line 652
def test_local_cache_of_read_nil
  @cache.with_local_cache do
    assert_equal nil, @cache.read('foo')
    @cache.send(:bypass_local_cache) { @cache.write 'foo', 'bar' }
    assert_equal nil, @cache.read('foo')
  end
end
test_local_cache_of_write()
# File activesupport/test/caching_test.rb, line 637
def test_local_cache_of_write
  @cache.with_local_cache do
    @cache.write('foo', 'bar')
    @peek.delete('foo')
    assert_equal 'bar', @cache.read('foo')
  end
end
test_local_cache_of_write_nil()
# File activesupport/test/caching_test.rb, line 667
def test_local_cache_of_write_nil
  @cache.with_local_cache do
    assert @cache.write('foo', nil)
    assert_nil @cache.read('foo')
    @peek.write('foo', 'bar')
    assert_nil @cache.read('foo')
  end
end
test_local_writes_are_persistent_on_the_remote_cache()
# File activesupport/test/caching_test.rb, line 619
def test_local_writes_are_persistent_on_the_remote_cache
  retval = @cache.with_local_cache do
    @cache.write('foo', 'bar')
  end
  assert retval
  assert_equal 'bar', @cache.read('foo')
end
test_middleware()
# File activesupport/test/caching_test.rb, line 710
def test_middleware
  app = lambda { |env|
    result = @cache.write('foo', 'bar')
    assert_equal 'bar', @cache.read('foo') # make sure 'foo' was written
    assert result
    [200, {}, []]
  }
  app = @cache.middleware.new(app)
  app.call({})
end