method
matches?
1.3.1 -
Show latest stable
-
0 notes -
Class: Spec::Matchers::RaiseException
- 1.1.4
- 1.1.12
- 1.2.0
- 1.2.8
- 1.3.0 (0)
- 1.3.1 (0)
- What's this?
matches?(given_proc)
public
Hide source
# File lib/spec/matchers/raise_exception.rb, line 15 def matches?(given_proc) @raised_expected_exception = false @with_expected_message = false @eval_block = false @eval_block_passed = false begin given_proc.call rescue @expected_exception => @actual_exception @raised_expected_exception = true @with_expected_message = verify_message rescue Exception => @actual_exception # This clause should be empty, but rcov will not report it as covered # unless something (anything) is executed within the clause rcov_exception_report = "http://eigenclass.org/hiki.rb?rcov-0.8.0" end unless negative_expectation? eval_block if @raised_expected_exception && @with_expected_message && @block end (@raised_expected_exception & @with_expected_message) ? (@eval_block ? @eval_block_passed : true) : false end