Class: ScraperWiki::API::Matchers::SetAnyOf

Inherits:
DatastoreMatcher 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_descriptionObject



482
483
484
# File 'lib/scraperwiki-api/matchers.rb', line 482

def failure_description
  "records didn't set any of #{@expected.join ','}"
end

#mismatchesObject



474
475
476
477
478
479
480
# File 'lib/scraperwiki-api/matchers.rb', line 474

def mismatches
  items.select do |item|
    @expected.all? do |field|
      item[field].respond_to?(:empty?) ? item[field].empty? : !item[field]
    end
  end
end

#negative_failure_descriptionObject



486
487
488
# File 'lib/scraperwiki-api/matchers.rb', line 486

def negative_failure_description
  "records set any of #{@expected.join ','}"
end