Class: Smartest::EqMatcher
- Inherits:
-
Object
- Object
- Smartest::EqMatcher
- Defined in:
- lib/smartest/matchers.rb
Instance Method Summary collapse
- #failure_message ⇒ Object
-
#initialize(expected) ⇒ EqMatcher
constructor
A new instance of EqMatcher.
- #matches?(actual) ⇒ Boolean
- #negated_failure_message ⇒ Object
Constructor Details
#initialize(expected) ⇒ EqMatcher
Returns a new instance of EqMatcher.
23 24 25 |
# File 'lib/smartest/matchers.rb', line 23 def initialize(expected) @expected = expected end |
Instance Method Details
#failure_message ⇒ Object
32 33 34 |
# File 'lib/smartest/matchers.rb', line 32 def "expected #{@actual.inspect} to eq #{@expected.inspect}" end |
#matches?(actual) ⇒ Boolean
27 28 29 30 |
# File 'lib/smartest/matchers.rb', line 27 def matches?(actual) @actual = actual actual == @expected end |
#negated_failure_message ⇒ Object
36 37 38 |
# File 'lib/smartest/matchers.rb', line 36 def "expected #{@actual.inspect} not to eq #{@expected.inspect}" end |