class Spec::Rails::Matchers::ArBeValid
:nodoc:
def description
def description "be valid" end
def failure_message_for_should
def failure_message_for_should if @actual.respond_to?(:errors) && ActiveRecord::Errors === @actual.errors "Expected #{@actual.inspect} to be valid, but it was not\nErrors: " + @actual.errors.full_messages.join(", ") else @matcher.failure_message_for_should end end
def failure_message_for_should_not
def failure_message_for_should_not @matcher.failure_message_for_should_not end
def initialize
def initialize @matcher = Spec::Matchers::Be.new :be_valid @matcher.__send__ :handling_predicate! end
def matches?(actual)
def matches?(actual) @actual = actual @matcher.matches? @actual end