module RSpec::Matchers::FailMatchers

def fail_with(message)

expect { some_expectation }.to fail_with(/some failure message/)
expect { some_expectation }.to fail_with("some failure message")
@example

Matches if an expectation fails with the provided message
def fail_with(message)
  raise_error(RSpec::Expectations::ExpectationNotMetError, message)
end