Class: ScraperWiki::API::Matchers::KeysMatcher
Instance Method Summary
collapse
#on
#does_not_match?, #initialize
Instance Method Details
#difference ⇒ Object
265
266
267
|
# File 'lib/scraperwiki-api/matchers.rb', line 265
def difference
raise NotImplementerError, 'Subclasses must implement this method'
end
|
#failure_message ⇒ Object
249
250
251
|
# File 'lib/scraperwiki-api/matchers.rb', line 249
def failure_message
"#{@actual['short_name']} #{failure_predicate}: #{difference.join ', '}"
end
|
#failure_predicate ⇒ Object
257
258
259
|
# File 'lib/scraperwiki-api/matchers.rb', line 257
def failure_predicate
raise NotImplementerError, 'Subclasses must implement this method'
end
|
#matches?(actual) ⇒ Boolean
244
245
246
247
|
# File 'lib/scraperwiki-api/matchers.rb', line 244
def matches?(actual)
super
difference.empty?
end
|
#negative_failure_message ⇒ Object
253
254
255
|
# File 'lib/scraperwiki-api/matchers.rb', line 253
def negative_failure_message
"#{@actual['short_name']} #{negative_failure_predicate}: #{difference.join ', '}"
end
|