Class: Mongoid::Matchers::BeDynamicDocument
- Inherits:
-
Object
- Object
- Mongoid::Matchers::BeDynamicDocument
- Defined in:
- lib/matchers/be_dynamic_document.rb
Instance Method Summary collapse
- #description ⇒ Object
- #failure_message ⇒ Object
- #failure_message_when_negated ⇒ Object
- #matches?(actual) ⇒ Boolean
Instance Method Details
#description ⇒ Object
13 14 15 |
# File 'lib/matchers/be_dynamic_document.rb', line 13 def description 'include Mongoid::Attributes::Dynamic' end |
#failure_message ⇒ Object
17 18 19 |
# File 'lib/matchers/be_dynamic_document.rb', line 17 def "expect #{@model.inspect} class to #{description}" end |
#failure_message_when_negated ⇒ Object
21 22 23 |
# File 'lib/matchers/be_dynamic_document.rb', line 21 def "expect #{@model.inspect} class to not #{description}" end |
#matches?(actual) ⇒ Boolean
8 9 10 11 |
# File 'lib/matchers/be_dynamic_document.rb', line 8 def matches?(actual) @model = actual.is_a?(Class) ? actual : actual.class @model.included_modules.include?(Mongoid::Attributes::Dynamic) end |