Class: ScraperWiki::API::Matchers::RunIntervalMatcher
Instance Method Summary
collapse
#does_not_match?, #initialize
Instance Method Details
#failure_message ⇒ Object
147
148
149
150
151
152
153
|
# File 'lib/scraperwiki-api/matchers.rb', line 147
def failure_message
if @expected == -1
"expected #{@actual['short_name']} to never run"
else
"expected #{@actual['short_name']} to run #{@expected}"
end
end
|
#matches?(actual) ⇒ Boolean
142
143
144
145
|
# File 'lib/scraperwiki-api/matchers.rb', line 142
def matches?(actual)
super
actual['run_interval'] == ScraperWiki::API::RUN_INTERVALS[@expected]
end
|
#negative_failure_message ⇒ Object
155
156
157
158
159
160
161
|
# File 'lib/scraperwiki-api/matchers.rb', line 155
def negative_failure_message
if @expected == -1
"expected #{@actual['short_name']} to run at some time"
else
"expected #{@actual['short_name']} to not run #{@expected}"
end
end
|