class Shoulda::Matchers::ActiveRecord::AssociationMatchers::CounterCacheMatcher
def description
def description "counter_cache => #{counter_cache}" end
def initialize(counter_cache, name)
def initialize(counter_cache, name) @counter_cache = counter_cache @name = name @missing_option = '' end
def matches?(subject)
def matches?(subject) self.subject = ModelReflector.new(subject, name) if option_verifier.correct_for_string?(:counter_cache, counter_cache) true else self.missing_option = "#{name} should have #{description}" false end end
def option_verifier
def option_verifier @option_verifier ||= OptionVerifier.new(subject) end