Class: Smartest::EqMatcher
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
Methods inherited from Matcher
Constructor Details
#initialize(expected) ⇒ EqMatcher
Returns a new instance of EqMatcher.
213 214 215 |
# File 'lib/smartest/matchers.rb', line 213 def initialize(expected) @expected = expected end |
Instance Method Details
#description ⇒ Object
230 231 232 |
# File 'lib/smartest/matchers.rb', line 230 def description "eq #{@expected.inspect}" end |
#failure_message ⇒ Object
222 223 224 |
# File 'lib/smartest/matchers.rb', line 222 def "expected #{@actual.inspect} to eq #{@expected.inspect}" end |
#matches?(actual) ⇒ Boolean
217 218 219 220 |
# File 'lib/smartest/matchers.rb', line 217 def matches?(actual) @actual = actual actual == @expected end |
#negated_failure_message ⇒ Object
226 227 228 |
# File 'lib/smartest/matchers.rb', line 226 def "expected #{@actual.inspect} not to eq #{@expected.inspect}" end |