Class: ScraperWiki::API::Matchers::CountMatcher
Instance Method Summary
collapse
Instance Method Details
#count ⇒ Object
340
341
342
343
344
345
346
|
# File 'lib/scraperwiki-api/matchers.rb', line 340
def count
if @actual['datasummary']['tables'][@table]
@actual['datasummary']['tables'][@table]['count']
else
0
end
end
|
#failure_message ⇒ Object
353
354
355
|
# File 'lib/scraperwiki-api/matchers.rb', line 353
def failure_message
"expected #{@actual['short_name']} to have #{@expected} rows, not #{count}"
end
|
#matches?(actual) ⇒ Boolean
348
349
350
351
|
# File 'lib/scraperwiki-api/matchers.rb', line 348
def matches?(actual)
super
count == @expected
end
|
#negative_failure_message ⇒ Object
357
358
359
|
# File 'lib/scraperwiki-api/matchers.rb', line 357
def negative_failure_message
"expected #{@actual['short_name']} to not have #{@expected} rows"
end
|