Class: ScraperWiki::API::Matchers::CustomMatcher

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

Direct Known Subclasses

DatastoreMatcher, ScraperInfoMatcher

Instance Method Summary collapse

Constructor Details

#initialize(expected) ⇒ CustomMatcher

Returns a new instance of CustomMatcher.



63
64
65
# File 'lib/scraperwiki-api/matchers.rb', line 63

def initialize(expected)
  @expected = expected
end

Instance Method Details

#does_not_match?(actual) ⇒ Boolean

Returns:

  • (Boolean)


71
72
73
# File 'lib/scraperwiki-api/matchers.rb', line 71

def does_not_match?(actual)
  @actual = actual
end

#failure_messageObject

Raises:

  • (NotImplementerError)


75
76
77
# File 'lib/scraperwiki-api/matchers.rb', line 75

def failure_message
  raise NotImplementerError, 'Subclasses must implement this method'
end

#matches?(actual) ⇒ Boolean

Returns:

  • (Boolean)


67
68
69
# File 'lib/scraperwiki-api/matchers.rb', line 67

def matches?(actual)
  @actual = actual
end

#negative_failure_messageObject

Raises:

  • (NotImplementerError)


79
80
81
# File 'lib/scraperwiki-api/matchers.rb', line 79

def negative_failure_message
  raise NotImplementerError, 'Subclasses must implement this method'
end