Class: ScraperWiki::API::Matchers::MissingKeysMatcher

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



292
293
294
295
296
297
298
299
# File 'lib/scraperwiki-api/matchers.rb', line 292

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

#failure_predicateObject



301
302
303
# File 'lib/scraperwiki-api/matchers.rb', line 301

def failure_predicate
  'is missing keys'
end

#negative_failure_predicateObject



305
306
307
# File 'lib/scraperwiki-api/matchers.rb', line 305

def negative_failure_predicate
  "isn't missing keys"
end