class Representable::Matchers::ExtensionOfMatcher

Public Instance Methods

description() click to toggle source
# File lib/matchers/extension_of_matcher.rb, line 11
def description
  "only allow representable properties extending specific representers"
end
failure_message_for_should() click to toggle source
# File lib/matchers/extension_of_matcher.rb, line 15
def failure_message_for_should
  "Expected #{expectation}"
end
failure_message_for_should_not() click to toggle source
# File lib/matchers/extension_of_matcher.rb, line 19
def failure_message_for_should_not
  "Did not expect #{expectation}"
end
matches?(subject) click to toggle source
# File lib/matchers/extension_of_matcher.rb, line 6
def matches?(subject)
  @subject = subject
  matches_extension?
end

Private Instance Methods

expectation() click to toggle source
# File lib/matchers/extension_of_matcher.rb, line 29
def expectation
  "#{@subject.class} to be a representation of #{extension}"
end
matches_extension?() click to toggle source
# File lib/matchers/extension_of_matcher.rb, line 25
def matches_extension?
  @subject.send(:representable_attrs)[property].options[:extend] == extension
end