Class List Method List File List

# Class: VertxUnit::Failure

Inherits:
  Object
  - Object
  - VertxUnit::Failure
  show all
Defined in:
  /Users/julien/java/vertx-aggregator/modules/vertx-unit/src/main/resources/vertx-unit/failure.rb

## Overview

A failure provides the details of a failure that happened during the execution of a test case.

The failure can be:

- an assertion failure: an assertion failed
- an error failure: an expected error occured

## Instance Method Summary (collapse)

- - (true, false) error?
  @return true if the failure is an error failure otherwise it is an assertion failure.
- - (String) message
  @return the error message.
- - (String) stack_trace
  @return the stack trace.

## Instance Method Details

### - (`true`, `false`) error?

@return true if the failure is an error failure otherwise it is an assertion failure

Returns:

- (`true`, `false`)

Raises:

- (`ArgumentError`)

    24
    25
    26
    27
    28
    29
    30
    31
    32
    # File '/Users/julien/java/vertx-aggregator/modules/vertx-unit/src/main/resources/vertx-unit/failure.rb', line 24

    def error?
      if !block_given?
        if @cached_is_error != nil
          return @cached_is_error
        end
        return @cached_is_error = @j_del.java_method(:isError, []).call()
      end
      raise ArgumentError, "Invalid arguments when calling error?()"
    end

### - (`String`) message

@return the error message

Returns:

- (`String`)

Raises:

- (`ArgumentError`)

    35
    36
    37
    38
    39
    40
    41
    42
    43
    # File '/Users/julien/java/vertx-aggregator/modules/vertx-unit/src/main/resources/vertx-unit/failure.rb', line 35

    def message
      if !block_given?
        if @cached_message != nil
          return @cached_message
        end
        return @cached_message = @j_del.java_method(:message, []).call()
      end
      raise ArgumentError, "Invalid arguments when calling message()"
    end

### - (`String`) stack_trace

@return the stack trace

Returns:

- (`String`)

Raises:

- (`ArgumentError`)

    46
    47
    48
    49
    50
    51
    52
    53
    54
    # File '/Users/julien/java/vertx-aggregator/modules/vertx-unit/src/main/resources/vertx-unit/failure.rb', line 46

    def stack_trace
      if !block_given?
        if @cached_stack_trace != nil
          return @cached_stack_trace
        end
        return @cached_stack_trace = @j_del.java_method(:stackTrace, []).call()
      end
      raise ArgumentError, "Invalid arguments when calling stack_trace()"
    end