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.



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

def initialize(expected)
  @expected = expected
end

Instance Method Details

#does_not_match?(actual) ⇒ Boolean

Returns:

  • (Boolean)


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

def does_not_match?(actual)
  @actual = actual
end

#failure_messageObject

Raises:

  • (NotImplementerError)


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

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

#matches?(actual) ⇒ Boolean

Returns:

  • (Boolean)


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

def matches?(actual)
  @actual = actual
end

#negative_failure_messageObject

Raises:

  • (NotImplementerError)


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

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