class Test::Unit::Assertions::AssertExceptionHelper

Public Class Methods

new(test_case, expected_exceptions) click to toggle source
# File test-unit-3.5.3/lib/test/unit/assertions.rb, line 2340
def initialize(test_case, expected_exceptions)
  @test_case = test_case
  @expected_exceptions = expected_exceptions
  @expected_classes, @expected_modules, @expected_objects =
    split_expected_exceptions(expected_exceptions)
end

Public Instance Methods

expected?(actual_exception, equality=nil) click to toggle source
# File test-unit-3.5.3/lib/test/unit/assertions.rb, line 2362
def expected?(actual_exception, equality=nil)
  equality ||= :instance_of?
  expected_class?(actual_exception, equality) or
    expected_module?(actual_exception) or
    expected_object?(actual_exception)
end
expected_exceptions() click to toggle source
# File test-unit-3.5.3/lib/test/unit/assertions.rb, line 2347
def expected_exceptions
  exceptions = @expected_exceptions.collect do |exception|
    if exception.is_a?(Exception)
      WrappedException.new(exception)
    else
      exception
    end
  end
  if exceptions.size == 1
    exceptions[0]
  else
    exceptions
  end
end