Class: Test::Unit::Assertions::AssertExceptionHelper::WrappedException — test-unit - test-unit

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

- (WrappedException) initialize(exception)

A new instance of WrappedException



1825
1826
1827
# File 'lib/test/unit/assertions.rb', line 1825

def initialize(exception)
  @exception = exception
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

- (Object) method_missing(name, *args, &block)



1837
1838
1839
# File 'lib/test/unit/assertions.rb', line 1837

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

Instance Attribute Details

- (Object) exception (readonly)

Returns the value of attribute exception



1824
1825
1826
# File 'lib/test/unit/assertions.rb', line 1824

def exception
  @exception
end

Instance Method Details

- (Object) inspect



1829
1830
1831
1832
1833
1834
1835
# File 'lib/test/unit/assertions.rb', line 1829

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