Methods
Attributes
| [R] | description |
Public Class methods
[ show source ]
# File lib/spec/matchers/simple_matcher.rb, line 6 6: def initialize(description, &match_block) 7: @description = description 8: @match_block = match_block 9: end
Public Instance methods
[ show source ]
# File lib/spec/matchers/simple_matcher.rb, line 16
16: def failure_message()
17: return %[expected #{@description.inspect} but got #{@actual.inspect}]
18: end
[ show source ]
# File lib/spec/matchers/simple_matcher.rb, line 11
11: def matches?(actual)
12: @actual = actual
13: return @match_block.call(@actual)
14: end
[ show source ]
# File lib/spec/matchers/simple_matcher.rb, line 20
20: def negative_failure_message()
21: return %[expected not to get #{@description.inspect}, but got #{@actual.inspect}]
22: end