class Specifier::Expectation

Configures an expectation (used for expect statements).

Usage:

expectation = Specifier::Expectation.new("today")
expectation.to(matcher) # 'raises 'ToError'

Public Class Methods

new(value) click to toggle source
# File lib/specifier/expectation.rb, line 13
def initialize(value)
  @value = value
end

Public Instance Methods

to(matcher) click to toggle source
# File lib/specifier/expectation.rb, line 17
def to(matcher)
  raise MatcherError, matcher.message unless matcher.match?(@value)
end