class Shoulda::Matchers::ActiveModel::ValidateComparisonOfMatcher
def build_submatcher_failure_message_for(
def build_submatcher_failure_message_for( submatcher, failure_message_method ) failure_message = submatcher.public_send(failure_message_method) submatcher_description = submatcher.simple_description. sub(/\bvalidate that\b/, 'validates'). sub(/\bdisallow\b/, 'disallows'). sub(/\ballow\b/, 'allows') submatcher_message = if number_of_submatchers_for_failure_message > 1 "In checking that #{model.name} #{submatcher_description}, " + failure_message[0].downcase + failure_message[1..] else failure_message end Shoulda::Matchers.word_wrap(submatcher_message, indent: 2) end