method
matches?
rspec latest stable - Class:
Spec::Matchers::RaiseError
matches?(given_proc)public
No documentation available.
# File lib/spec/matchers/raise_error.rb, line 15
def matches?(given_proc)
@raised_expected_error = false
@with_expected_message = false
@eval_block = false
@eval_block_passed = false
begin
given_proc.call
rescue @expected_error => @actual_error
@raised_expected_error = true
@with_expected_message = verify_message
rescue Exception => @actual_error
# This clause should be empty, but rcov will not report it as covered
# unless something (anything) is executed within the clause
rcov_error_report = "http://eigenclass.org/hiki.rb?rcov-0.8.0"
end
unless negative_expectation?
eval_block if @raised_expected_error && @with_expected_message && @block
end
ensure
return (@raised_expected_error & @with_expected_message) ? (@eval_block ? @eval_block_passed : true) : false
end