Class: ScraperWiki::API::Matchers::HaveValuesStartingWith

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



655
656
657
# File 'lib/scraperwiki-api/matchers.rb', line 655

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

#match?(v) ⇒ Boolean

Returns:

  • (Boolean)


651
652
653
# File 'lib/scraperwiki-api/matchers.rb', line 651

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

#negative_failure_predicateObject



659
660
661
# File 'lib/scraperwiki-api/matchers.rb', line 659

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