class Shoulda::Matchers::ActiveRecord::HaveDbIndexMatcher

def failure_message

def failure_message
  message =
    "Expected #{described_table_name} to #{positive_expectation}"
  message <<
    if index_exists?
      ". The index does exist, but #{reason}."
    elsif reason
      ", but #{reason}."
    else
      ', but it does not.'
    end
  Shoulda::Matchers.word_wrap(message)
end