class Representable::Matchers::RepresentablePropertyMatcher
Public Instance Methods
description()
click to toggle source
# File lib/matchers/representable_property_matcher.rb, line 11 def description "only allow models with specific representable properties" end
failure_message_for_should()
click to toggle source
# File lib/matchers/representable_property_matcher.rb, line 15 def failure_message_for_should "Expected #{expectation}" end
failure_message_for_should_not()
click to toggle source
# File lib/matchers/representable_property_matcher.rb, line 19 def failure_message_for_should_not "Did not expect #{expectation}" end
matches?(subject)
click to toggle source
# File lib/matchers/representable_property_matcher.rb, line 6 def matches?(subject) @subject = subject representable_attribute? end
Private Instance Methods
expectation()
click to toggle source
# File lib/matchers/representable_property_matcher.rb, line 29 def expectation "#{@subject} to be a Representable property" end
representable_attribute?()
click to toggle source
# File lib/matchers/representable_property_matcher.rb, line 25 def representable_attribute? !@subject.send(:representable_attrs)[property].nil? end