Class: Cybertrain::Test::Base

Inherits:
Object
  • Object
show all
Defined in:
cybertrain/test/test_case.rb

Overview

The base of every test class: empty setup and teardown for the subclasses’ overrides to call with super.

Direct Known Subclasses

ActiveSupport::TestCase

Instance Method Summary collapse

Instance Method Details

#setup ⇒ nil

Runs before each test; an override calls super first. Given a block, it is a declaration that gen did not convert: refused.

Returns:

  • (nil)

Raises:

  • (ArgumentError) —

    when given a block



62
63
64
65
66
67
68
# File 'cybertrain/test/test_case.rb', line 62

def setup
  if block_given?
    message = DECLARED_INSIDE
    raise ArgumentError, message
  end
  nil
end

#teardown ⇒ nil

Runs after each test, whatever happened in it; an override calls super last. Given a block, it is a declaration that gen did not convert: refused.

Returns:

  • (nil)

Raises:

  • (ArgumentError) —

    when given a block



76
77
78
79
80
81
82
# File 'cybertrain/test/test_case.rb', line 76

def teardown
  if block_given?
    message = DECLARED_INSIDE
    raise ArgumentError, message
  end
  nil
end