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.
38 39 40 |
# File 'lib/smartest/matchers.rb', line 38 def initialize(expected) @expected = expected end |
Instance Method Details
#failure_message ⇒ Object
47 48 49 |
# File 'lib/smartest/matchers.rb', line 47 def "expected #{@actual.inspect} to eq #{@expected.inspect}" end |
#matches?(actual) ⇒ Boolean
42 43 44 45 |
# File 'lib/smartest/matchers.rb', line 42 def matches?(actual) @actual = actual actual == @expected end |
#negated_failure_message ⇒ Object
51 52 53 |
# File 'lib/smartest/matchers.rb', line 51 def "expected #{@actual.inspect} not to eq #{@expected.inspect}" end |