Class List Method List File List

# Class: VertxUnit::TestCase

Inherits:
  Object
  - Object
  - VertxUnit::TestCase
  show all
Defined in:
  /Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-unit/test_case.rb

## Overview

A test case object can be used to create a single test.

## Constant Summary

@@j_api_type =

      Object.new

## Class Method Summary (collapse)

- + (Boolean) accept?(obj)
- + (::VertxUnit::TestCase) create(name = nil) { ... }
  Create a test case.
- + (Object) j_api_type
- + (Object) j_class
- + (Object) unwrap(obj)
- + (Object) wrap(obj)

## Class Method Details

### + (`Boolean`) accept?(obj)

Returns:

- (`Boolean`)

    18
    19
    20
    # File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-unit/test_case.rb', line 18

    def @@j_api_type.accept?(obj)
      obj.class == TestCase
    end

### + (`::VertxUnit::TestCase`) create(name = nil) { ... }

Create a test case.

Parameters:

- name (`String`) (defaults to: `nil`) —
  the test case name

Yields:

- the test case

Returns:

- (`::VertxUnit::TestCase`) —
  the created test case

Raises:

- (`ArgumentError`)

    37
    38
    39
    40
    41
    42
    # File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-unit/test_case.rb', line 37

    def self.create(name=nil)
      if name.class == String && block_given?
        return ::Vertx::Util::Utils.safe_create(Java::IoVertxExtUnit::TestCase.java_method(:create, [Java::java.lang.String.java_class,Java::IoVertxCore::Handler.java_class]).call(name,(Proc.new { |event| yield(::Vertx::Util::Utils.safe_create(event,::VertxUnit::TestContext)) })),::VertxUnit::TestCase)
      end
      raise ArgumentError, "Invalid arguments when calling create(#{name})"
    end

### + (`Object`) j_api_type

    27
    28
    29
    # File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-unit/test_case.rb', line 27

    def self.j_api_type
      @@j_api_type
    end

### + (`Object`) j_class

    30
    31
    32
    # File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-unit/test_case.rb', line 30

    def self.j_class
      Java::IoVertxExtUnit::TestCase.java_class
    end

### + (`Object`) unwrap(obj)

    24
    25
    26
    # File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-unit/test_case.rb', line 24

    def @@j_api_type.unwrap(obj)
      obj.j_del
    end

### + (`Object`) wrap(obj)

    21
    22
    23
    # File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-unit/test_case.rb', line 21

    def @@j_api_type.wrap(obj)
      TestCase.new(obj)
    end