Module: RSpec::Matchers::FailMatchers
- Defined in:
- lib/rspec/matchers/fail_matchers.rb
Overview
Matchers for testing RSpec matchers. Include them with:
require 'rspec/matchers/fail_matchers'
RSpec.configure do |config|
config.include RSpec::Matchers::FailMatchers
end
Instance Method Summary (collapse)
-
- (Object) fail(&block)
Matches if an expectation fails.
-
- (Object) fail_including(*snippets)
Matches if an expectation fails including the provided message.
-
- (Object) fail_with(message)
Matches if an expectation fails with the provided message.
Instance Method Details
- (Object) fail(&block)
Matches if an expectation fails
17 18 19 |
# File 'lib/rspec/matchers/fail_matchers.rb', line 17 def fail(&block) raise_error(RSpec::Expectations::ExpectationNotMetError, &block) end |
- (Object) fail_including(*snippets)
Matches if an expectation fails including the provided message
34 35 36 37 38 39 |
# File 'lib/rspec/matchers/fail_matchers.rb', line 34 def fail_including(*snippets) raise_error( RSpec::Expectations::ExpectationNotMetError, a_string_including(*snippets) ) end |
- (Object) fail_with(message)
Matches if an expectation fails with the provided message
26 27 28 |
# File 'lib/rspec/matchers/fail_matchers.rb', line 26 def fail_with() raise_error(RSpec::Expectations::ExpectationNotMetError, ) end |