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

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(exception) ⇒ WrappedException

Returns a new instance of WrappedException.



1891
1892
1893
# File 'lib/test/unit/assertions.rb', line 1891

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



1903
1904
1905
# File 'lib/test/unit/assertions.rb', line 1903

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

Instance Attribute Details

#exceptionObject (readonly)

Returns the value of attribute exception.



1890
1891
1892
# File 'lib/test/unit/assertions.rb', line 1890

def exception
  @exception
end

Instance Method Details

#inspectObject



1895
1896
1897
1898
1899
1900
1901
# File 'lib/test/unit/assertions.rb', line 1895

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