Class: Test::Unit::Assertions::AssertExceptionHelper::WrappedException

Inherits:
Object
  • Object
show all
Defined in:
lib/test/unit/assertions.rb,
lib/test/unit/assertions.rb,
lib/test/unit/assertions.rb,
lib/test/unit/assertions.rb,
lib/test/unit/assertions.rb,
lib/test/unit/assertions.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(exception) ⇒ WrappedException

Returns a new instance of WrappedException



2079
2080
2081
# File 'lib/test/unit/assertions.rb', line 2079

def initialize(exception)
  @exception = exception
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(name, *args, &block) ⇒ Object



2091
2092
2093
# File 'lib/test/unit/assertions.rb', line 2091

def method_missing(name, *args, &block)
  @exception.__send__(name, *args, &block)
end

Instance Attribute Details

#exceptionObject (readonly)

Returns the value of attribute exception



2078
2079
2080
# File 'lib/test/unit/assertions.rb', line 2078

def exception
  @exception
end

Instance Method Details

#inspectObject



2083
2084
2085
2086
2087
2088
2089
# File 'lib/test/unit/assertions.rb', line 2083

def inspect
  if default_inspect?
    "#{@exception.class.inspect}(<#{@exception.message}>)"
  else
    @exception.inspect
  end
end