/usr/lib/ruby/vendor_ruby/rspec/matchers/fail_matchers.rb is in ruby-rspec-expectations 3.4.0c3e0m1s1-1ubuntu1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 | require 'rspec/expectations'
module RSpec
module Matchers
# Matchers for testing RSpec matchers. Include them with:
#
# require 'rspec/matchers/fail_matchers'
# RSpec.configure do |config|
# config.include RSpec::Matchers::FailMatchers
# end
#
module FailMatchers
# Matches if an expectation fails
#
# @example
# expect { some_expectation }.to fail
def fail(&block)
raise_error(RSpec::Expectations::ExpectationNotMetError, &block)
end
# Matches if an expectation fails with the provided message
#
# @example
# expect { some_expectation }.to fail_with("some failure message")
# expect { some_expectation }.to fail_with(/some failure message/)
def fail_with(message)
raise_error(RSpec::Expectations::ExpectationNotMetError, message)
end
# Matches if an expectation fails including the provided message
#
# @example
# expect { some_expectation }.to fail_including("portion of some failure message")
def fail_including(*snippets)
raise_error(
RSpec::Expectations::ExpectationNotMetError,
a_string_including(*snippets)
)
end
end
end
end
|