Class: Polyrun::Quick::EqMatcher
- Inherits:
-
Object
- Object
- Polyrun::Quick::EqMatcher
- Defined in:
- lib/polyrun/quick/matchers.rb
Instance Method Summary collapse
- #does_not_match?(actual) ⇒ Boolean
- #failure_message(actual) ⇒ Object
- #failure_message_when_negated(actual) ⇒ Object
-
#initialize(expected) ⇒ EqMatcher
constructor
A new instance of EqMatcher.
- #matches?(actual) ⇒ Boolean
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
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 (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 (actual) "expected #{actual.inspect} not to eq #{@expected.inspect}" end |
#matches?(actual) ⇒ Boolean
55 56 57 |
# File 'lib/polyrun/quick/matchers.rb', line 55 def matches?(actual) @expected == actual end |