Sha256: 75fea963511c56204f9aef951b599b52eaed4144d0b7f5136c6977ddd340d0cd
Contents?: true
Size: 550 Bytes
Versions: 6
Compression:
Stored size: 550 Bytes
Contents
require "test_helper" class CacheKeeper::CachedMethodTest < ActiveSupport::TestCase test "#call caches the result of the original method" do recording = Recording.new(number: 5) cached_method = manager.handle(Recording, :another_method, expires_in: 1.hour) manager.activate_if_handling(Recording, :another_method) result = cached_method.call(recording) assert_equal 5, result assert cache_has_key? "CacheKeeper/Recording/another_method" end private def manager @manager ||= CacheKeeper::Manager.new end end
Version data entries
6 entries across 6 versions & 1 rubygems