Class: Smartest::EqMatcher
- Inherits:
-
Object
- Object
- Smartest::EqMatcher
- Defined in:
- lib/smartest/matchers.rb
Instance Method Summary collapse
- #description ⇒ Object
- #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.
58 59 60 |
# File 'lib/smartest/matchers.rb', line 58 def initialize(expected) @expected = expected end |
Instance Method Details
#description ⇒ Object
75 76 77 |
# File 'lib/smartest/matchers.rb', line 75 def description "eq #{@expected.inspect}" end |
#failure_message ⇒ Object
67 68 69 |
# File 'lib/smartest/matchers.rb', line 67 def "expected #{@actual.inspect} to eq #{@expected.inspect}" end |
#matches?(actual) ⇒ Boolean
62 63 64 65 |
# File 'lib/smartest/matchers.rb', line 62 def matches?(actual) @actual = actual actual == @expected end |
#negated_failure_message ⇒ Object
71 72 73 |
# File 'lib/smartest/matchers.rb', line 71 def "expected #{@actual.inspect} not to eq #{@expected.inspect}" end |