method

matches?

Importance_0
RSpec latest stable (1.3.1) - 0 notes - Class: Spec::Matchers::RaiseException
matches?(given_proc) public

No documentation

This method has no description. You can help the RSpec community by adding new notes.

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
Register or log in to add new notes.