Class: Polyrun::Quick::EqMatcher

Inherits:
Object
  • Object
show all
Defined in:
lib/polyrun/quick/matchers.rb

Instance Method Summary collapse

Constructor Details

#initialize(expected) ⇒ EqMatcher

Returns a new instance of EqMatcher.



51
52
53
# File 'lib/polyrun/quick/matchers.rb', line 51

def initialize(expected)
  @expected = expected
end

Instance Method Details

#does_not_match?(actual) ⇒ Boolean

Returns:

  • (Boolean)


59
60
61
# File 'lib/polyrun/quick/matchers.rb', line 59

def does_not_match?(actual)
  !matches?(actual)
end

#failure_message(actual) ⇒ Object



63
64
65
# File 'lib/polyrun/quick/matchers.rb', line 63

def failure_message(actual)
  "expected #{@expected.inspect}, got #{actual.inspect}"
end

#failure_message_when_negated(actual) ⇒ Object



67
68
69
# File 'lib/polyrun/quick/matchers.rb', line 67

def failure_message_when_negated(actual)
  "expected #{actual.inspect} not to eq #{@expected.inspect}"
end

#matches?(actual) ⇒ Boolean

Returns:

  • (Boolean)


55
56
57
# File 'lib/polyrun/quick/matchers.rb', line 55

def matches?(actual)
  @expected == actual
end