Class: ScraperWiki::API::Matchers::SetAnyOf
- Inherits:
-
DatastoreMatcher
- Object
- CustomMatcher
- DatastoreMatcher
- ScraperWiki::API::Matchers::SetAnyOf
- Defined in:
- lib/scraperwiki-api/matchers.rb
Instance Method Summary collapse
Methods inherited from DatastoreMatcher
#does_not_match?, #failure_message, #failure_size, #failures, #items, #matches, #matches?, #negative_failure_message
Methods inherited from CustomMatcher
#does_not_match?, #failure_message, #initialize, #matches?, #negative_failure_message
Constructor Details
This class inherits a constructor from ScraperWiki::API::Matchers::CustomMatcher
Instance Method Details
#failure_description ⇒ Object
439 440 441 |
# File 'lib/scraperwiki-api/matchers.rb', line 439 def failure_description "records didn't set any of #{@expected.join ','}" end |
#mismatches ⇒ Object
431 432 433 434 435 436 437 |
# File 'lib/scraperwiki-api/matchers.rb', line 431 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_description ⇒ Object
443 444 445 |
# File 'lib/scraperwiki-api/matchers.rb', line 443 def negative_failure_description "records set any of #{@expected.join ','}" end |