class Test::Unit::Assertions::AssertExceptionHelper::WrappedException

Attributes

exception[R]

Public Class Methods

new(exception) click to toggle source
# File lib/test/unit/assertions.rb, line 2111
def initialize(exception)
  @exception = exception
end

Public Instance Methods

inspect() click to toggle source
# File lib/test/unit/assertions.rb, line 2115
def inspect
  if default_inspect?
    "#{@exception.class.inspect}(<#{@exception.message}>)"
  else
    @exception.inspect
  end
end
method_missing(name, *args, &block) click to toggle source
# File lib/test/unit/assertions.rb, line 2123
def method_missing(name, *args, &block)
  @exception.__send__(name, *args, &block)
end

Private Instance Methods

default_inspect?() click to toggle source
# File lib/test/unit/assertions.rb, line 2128
def default_inspect?
  inspect_method = @exception.method(:inspect)
  if inspect_method.respond_to?(:owner) and
      inspect_method.owner == Exception
    true
  else
    default_inspect_method = Exception.instance_method(:inspect)
    default_inspect_method.bind(@exception).call == @exception.inspect
  end
end