Class: ScraperWiki::API::Matchers::TableMatcher

Inherits:
ScraperInfoMatcher show all
Defined in:
lib/scraperwiki-api/matchers.rb

Instance Method Summary collapse

Constructor Details

This class inherits a constructor from ScraperWiki::API::Matchers::CustomMatcher

Instance Method Details

#failure_messageObject



243
244
245
# File 'lib/scraperwiki-api/matchers.rb', line 243

def failure_message
  "expected #{@actual['short_name']} to have a #{@expected} table"
end

#matches?(actual) ⇒ Boolean

Returns:

  • (Boolean)


238
239
240
241
# File 'lib/scraperwiki-api/matchers.rb', line 238

def matches?(actual)
  super
  actual['datasummary']['tables'].key?(@expected)
end

#negative_failure_messageObject



247
248
249
# File 'lib/scraperwiki-api/matchers.rb', line 247

def negative_failure_message
  "expected #{@actual['short_name']} to not have a #{@expected} table"
end