Class: ScraperWiki::API::Matchers::HaveValuesEndingWith

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

Instance Method Summary collapse

Methods inherited from FieldMatcher

#at, #blank?, #failure_description, #in, #matcher, #matches, #mismatches, #negative_failure_description

Methods inherited from DatastoreMatcher

#does_not_match?, #failure_description, #failure_message, #failure_size, #failures, #items, #matches, #matches?, #mismatches, #negative_failure_description, #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_predicateObject



674
675
676
# File 'lib/scraperwiki-api/matchers.rb', line 674

def failure_predicate
  "don't end with #{@expected}"
end

#match?(v) ⇒ Boolean

Returns:

  • (Boolean)


670
671
672
# File 'lib/scraperwiki-api/matchers.rb', line 670

def match?(v)
  v.end_with? @expected
end

#negative_failure_predicateObject



678
679
680
# File 'lib/scraperwiki-api/matchers.rb', line 678

def negative_failure_predicate
  "end with #{@expected}"
end