Class: ScraperWiki::API::Matchers::ExtraKeysMatcher

Inherits:
KeysMatcher 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

#differenceObject



316
317
318
319
320
321
322
323
# File 'lib/scraperwiki-api/matchers.rb', line 316

def difference
  keys = if @actual['datasummary']['tables'][@table]
    @actual['datasummary']['tables'][@table]['keys']
  else
    []
  end
  keys - @expected
end

#failure_predicateObject



325
326
327
# File 'lib/scraperwiki-api/matchers.rb', line 325

def failure_predicate
  'has extra keys'
end

#negative_failure_predicateObject



329
330
331
# File 'lib/scraperwiki-api/matchers.rb', line 329

def negative_failure_predicate
  'has no extra keys'
end