Class: MuckEngine::Models::Matchers::NestedAttributeMatcher
- Inherits:
-
MuckMatcherBase
- Object
- MuckMatcherBase
- MuckEngine::Models::Matchers::NestedAttributeMatcher
- Defined in:
- lib/muck-engine/test/models/matchers/nested_attribute_matcher.rb
Overview
:nodoc:
Instance Method Summary collapse
- #description ⇒ Object
- #failure_message ⇒ Object
-
#initialize(nested_model) ⇒ NestedAttributeMatcher
constructor
A new instance of NestedAttributeMatcher.
- #matches?(subject) ⇒ Boolean
Constructor Details
#initialize(nested_model) ⇒ NestedAttributeMatcher
Returns a new instance of NestedAttributeMatcher.
12 13 14 |
# File 'lib/muck-engine/test/models/matchers/nested_attribute_matcher.rb', line 12 def initialize(nested_model) @nested_model = nested_model end |
Instance Method Details
#description ⇒ Object
25 26 27 |
# File 'lib/muck-engine/test/models/matchers/nested_attribute_matcher.rb', line 25 def description "accepts nested attributes for" end |
#failure_message ⇒ Object
21 22 23 |
# File 'lib/muck-engine/test/models/matchers/nested_attribute_matcher.rb', line 21 def "#{factory_name} does not accept nested attributes for #{@nested_model}" end |
#matches?(subject) ⇒ Boolean
16 17 18 19 |
# File 'lib/muck-engine/test/models/matchers/nested_attribute_matcher.rb', line 16 def matches?(subject) @subject = subject @subject.methods.include?("#{@nested_model}_attributes=") end |