Class: Is::RSpec::Matcher
- Inherits:
-
Object
- Object
- Is::RSpec::Matcher
- Defined in:
- lib/is/rspec.rb
Instance Method Summary collapse
- #description ⇒ Object
- #failure_message ⇒ Object
-
#initialize(type) ⇒ Matcher
constructor
A new instance of Matcher.
- #matches?(it) ⇒ Boolean
Constructor Details
#initialize(type) ⇒ Matcher
Returns a new instance of Matcher.
6 7 8 |
# File 'lib/is/rspec.rb', line 6 def initialize type @type = type end |
Instance Method Details
#description ⇒ Object
19 20 21 |
# File 'lib/is/rspec.rb', line 19 def description "be of #{@type}" end |
#failure_message ⇒ Object
15 16 17 |
# File 'lib/is/rspec.rb', line 15 def @instance.to_s end |
#matches?(it) ⇒ Boolean
10 11 12 13 |
# File 'lib/is/rspec.rb', line 10 def matches? it @instance = @type.new it @instance.ok? end |