method
matches?
1.1.4 -
Show latest stable
-
0 notes -
Class: Spec::Matchers::RaiseError
- 1.1.4 (0)
- 1.1.12 (0)
- 1.2.0 (0)
- 1.2.8 (0)
- 1.3.0
- 1.3.1
- What's this?
matches?(proc)
public
Hide source
# File lib/spec/matchers/raise_error.rb, line 14 def matches?(proc) @raised_expected_error = false @with_expected_message = false @eval_block = false @eval_block_passed = false begin 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