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

属性

exception[R]

公共类方法

new(exception) 点击以切换源代码
# File test-unit-3.6.7/lib/test/unit/assertions.rb, line 2396
def initialize(exception)
  @exception = exception
end

公共实例方法

inspect() 点击以切换源代码
# File test-unit-3.6.7/lib/test/unit/assertions.rb, line 2400
def inspect
  if default_inspect?
    inspected = "#{@exception.class.inspect}(<#{@exception.message}>)"
    unless (@exception.backtrace || []).empty?
      inspected += "\n"
      @exception.backtrace.each do |trace|
        inspected << "#{trace}\n"
      end
    end
    inspected
  else
    @exception.inspect
  end
end
method_missing(name, *args, &block) 点击以切换源代码
# File test-unit-3.6.7/lib/test/unit/assertions.rb, line 2415
def method_missing(name, *args, &block)
  @exception.__send__(name, *args, &block)
end

私有实例方法

default_inspect?() 点击以切换源代码
# File test-unit-3.6.7/lib/test/unit/assertions.rb, line 2420
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