Class: Typ::RSpec::Matcher
- Inherits:
-
Object
- Object
- Typ::RSpec::Matcher
- Defined in:
- lib/typ/rspec/matcher.rb
Instance Method Summary collapse
- #description ⇒ Object
- #failure_message ⇒ Object
-
#initialize(typ_class) ⇒ Matcher
constructor
A new instance of Matcher.
- #matches?(it) ⇒ Boolean
Constructor Details
#initialize(typ_class) ⇒ Matcher
Returns a new instance of Matcher.
7 8 9 |
# File 'lib/typ/rspec/matcher.rb', line 7 def initialize typ_class @typ_class = typ_class end |
Instance Method Details
#description ⇒ Object
21 22 23 |
# File 'lib/typ/rspec/matcher.rb', line 21 def description "be #{@typ_class}" end |
#failure_message ⇒ Object
17 18 19 |
# File 'lib/typ/rspec/matcher.rb', line 17 def @it.ai + "\n" + Formatter.new(@typ).to_s end |
#matches?(it) ⇒ Boolean
11 12 13 14 15 |
# File 'lib/typ/rspec/matcher.rb', line 11 def matches? it @it = it @typ = @typ_class.new it @typ.ok? end |