Class: CachingMatcher::BeCachedMatcher
Instance Attribute Summary
Attributes inherited from MatcherBase
#cache_key
Instance Method Summary
collapse
Methods inherited from MatcherBase
#initialize
Instance Method Details
#failure_message_for_should ⇒ Object
54
55
56
57
58
59
60
|
# File 'lib/caching_matcher/caching_matcher.rb', line 54
def failure_message_for_should
if @before
"Key: #{@cache_key} was cached before operation. Did you forget to call ActionController::Base.cache_store.clear in the before block?"
elsif !@after
"Key: #{@cache_key} was not cached after operation but should have been."
end
end
|
#failure_message_for_should_not ⇒ Object
62
63
64
65
66
|
# File 'lib/caching_matcher/caching_matcher.rb', line 62
def failure_message_for_should_not
if @after
"Key: #{@cache_key} was cached after operation but should not have been."
end
end
|
#matches?(event_proc) ⇒ Boolean
49
50
51
52
|
# File 'lib/caching_matcher/caching_matcher.rb', line 49
def matches?(event_proc)
run_match(event_proc)
!@before && @after
end
|