Class ActiveMatchers::Matchers::AssociationMatcher
In: lib/matchers/association_matcher.rb
Parent: Object

Methods

Public Class methods

[Source]

   # File lib/matchers/association_matcher.rb, line 4
4:       def initialize(macro, *attributes)
5:         @macro = macro
6:         @attributes = attributes
7:       end

Public Instance methods

[Source]

    # File lib/matchers/association_matcher.rb, line 14
14:       def failure_message
15:         "Error: #{@error}"
16:       end

[Source]

    # File lib/matchers/association_matcher.rb, line 9
 9:       def matches?(model)
10:         @model = model
11:         confirm_association
12:       end

[Source]

    # File lib/matchers/association_matcher.rb, line 23
23:       def through(assoc)
24:         @options ||= {}
25:         @options[:through] = assoc
26:         self
27:       end

[Source]

    # File lib/matchers/association_matcher.rb, line 18
18:       def with_options(options)
19:         @options = options
20:         self
21:       end

[Validate]