Class: CachingMatcher::BeExpiredMatcher
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
78
79
80
81
82
83
84
|
# File 'lib/caching_matcher/caching_matcher.rb', line 78
def failure_message_for_should
if !@before
"Key: #{@cache_key} was not cached before operation but should have been. Did you forget to prime the cache?"
elsif @after
"Key: #{@cache_key} was cached after operation but should not have been."
end
end
|
#failure_message_for_should_not ⇒ Object
86
87
88
89
90
91
92
|
# File 'lib/caching_matcher/caching_matcher.rb', line 86
def failure_message_for_should_not
if @before
"Key: #{@cache_key} was cached before operation but should not have been. Did you forget to clear the cache in a before block?"
elsif !@after
"Key: #{@cache_key} was not cached after operation but should have been."
end
end
|
#matches?(event_proc) ⇒ Boolean
74
75
76
77
|
# File 'lib/caching_matcher/caching_matcher.rb', line 74
def matches?(event_proc)
run_match(event_proc)
@before && !@after
end
|