Class: ScraperWiki::API::Matchers::RunIntervalMatcher

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

Instance Method Summary collapse

Constructor Details

This class inherits a constructor from ScraperWiki::API::Matchers::CustomMatcher

Instance Method Details

#failure_messageObject



148
149
150
151
152
153
154
# File 'lib/scraperwiki-api/matchers.rb', line 148

def failure_message
  if @expected == -1
    "expected #{@actual['short_name']} to never run"
  else
    "expected #{@actual['short_name']} to run #{@expected}"
  end
end

#matches?(actual) ⇒ Boolean

Returns:

  • (Boolean)


143
144
145
146
# File 'lib/scraperwiki-api/matchers.rb', line 143

def matches?(actual)
  super
  actual['run_interval'] == ScraperWiki::API::RUN_INTERVALS[@expected]
end

#negative_failure_messageObject



156
157
158
159
160
161
162
# File 'lib/scraperwiki-api/matchers.rb', line 156

def negative_failure_message
  if @expected == -1
    "expected #{@actual['short_name']} to run at some time"
  else
    "expected #{@actual['short_name']} to not run #{@expected}"
  end
end