class RSpec::Rails::Matchers::BeValid

def failure_message_for_should

Other tags:
    Api: - private
def failure_message_for_should
  message = "expected #{actual.inspect} to be valid"
  if actual.respond_to?(:errors)
    message << ", but got errors: #{actual.errors.full_messages.join(', ')}"
  end
  message
end

def failure_message_for_should_not

Other tags:
    Api: - private
def failure_message_for_should_not
  "expected #{actual.inspect} not to be valid"
end

def initialize(*args)

def initialize(*args)
  @args = args
end

def matches?(actual)

Other tags:
    Api: - private
def matches?(actual)
  @actual = actual
  actual.valid?(*@args)
end