class RSpec::Matchers::BuiltIn::RaiseError
def matches?(given_proc, negative_expectation=false, &block)
- Private: -
def matches?(given_proc, negative_expectation=false, &block) @given_proc = given_proc @block ||= block @raised_expected_error = false @with_expected_message = false @eval_block = false @eval_block_passed = false return false unless Proc === given_proc begin given_proc.call rescue Exception => @actual_error if values_match?(@expected_error, @actual_error) || values_match?(@expected_error, actual_error_message) @raised_expected_error = true @with_expected_message = verify_message end end unless negative_expectation warn_about_bare_error! if warn_about_bare_error? warn_about_nil_error! if warn_about_nil_error? eval_block if ready_to_eval_block? end expectation_matched? end