Class: NoBrainer::Matchers::BeNoBrainerDocument
- Inherits:
-
Object
- Object
- NoBrainer::Matchers::BeNoBrainerDocument
- Defined in:
- lib/matchers/be_nobrainer_document.rb
Instance Method Summary collapse
- #description ⇒ Object
- #failure_message ⇒ Object
- #failure_message_when_negated ⇒ Object
- #matches?(actual) ⇒ Boolean
Instance Method Details
#description ⇒ Object
15 16 17 |
# File 'lib/matchers/be_nobrainer_document.rb', line 15 def description 'include NoBrainer::Document' end |
#failure_message ⇒ Object
19 20 21 |
# File 'lib/matchers/be_nobrainer_document.rb', line 19 def "expect #{@model.inspect} class to #{description}" end |
#failure_message_when_negated ⇒ Object
23 24 25 |
# File 'lib/matchers/be_nobrainer_document.rb', line 23 def "expect #{@model.inspect} class to not #{description}" end |
#matches?(actual) ⇒ Boolean
10 11 12 13 |
# File 'lib/matchers/be_nobrainer_document.rb', line 10 def matches?(actual) @model = actual.is_a?(Class) ? actual : actual.class @model.included_modules.include?(NoBrainer::Document) end |