Module: Micron::TestCase::LifecycleHooks

Included in:
Micron::TestCase
Defined in:
lib/micron/test_case/lifecycle_hooks.rb

Instance Method Summary collapse

Instance Method Details

#after_setupObject

Runs before every test, after setup. This hook is meant for libraries to extend minitest. It is not meant to be used by test developers.

See #before_setup for an example.



45
46
# File 'lib/micron/test_case/lifecycle_hooks.rb', line 45

def after_setup
end

#after_teardownObject

Runs after every test, after teardown. This hook is meant for libraries to extend minitest. It is not meant to be used by test developers.

See #before_setup for an example.



61
62
# File 'lib/micron/test_case/lifecycle_hooks.rb', line 61

def after_teardown
end

#before_setupObject

Runs before every test, before setup. This hook is meant for libraries to extend minitest. It is not meant to be used by test developers.

As a simplistic example:

module MyMinitestPlugin
  def before_setup
    super
    # ... stuff to do before setup is run
  end

  def after_setup
    # ... stuff to do after setup is run
    super
  end

  def before_teardown
    super
    # ... stuff to do before teardown is run
  end

  def after_teardown
    # ... stuff to do after teardown is run
    super
  end
end

class MiniTest::Unit::TestCase
  include MyMinitestPlugin
end


37
38
# File 'lib/micron/test_case/lifecycle_hooks.rb', line 37

def before_setup
end

#before_teardownObject

Runs after every test, before teardown. This hook is meant for libraries to extend minitest. It is not meant to be used by test developers.

See #before_setup for an example.



53
54
# File 'lib/micron/test_case/lifecycle_hooks.rb', line 53

def before_teardown
end