class Microtest::Test

Included Modules

Defined in:

microtest/test.cr

Constant Summary

FOCUSED_TESTNAME_PREFIX = "__testf"
GENERAL_TESTNAME_PREFIX = "__test"
GENERAL_TESTNAME_REGEX = /__test(f)?__/

Constructors

Class Method Summary

Instance Method Summary

Macro Summary

Instance methods inherited from module Microtest::PowerAssert

assert_raises(exception_type : Exception.class, file : String = __FILE__, line : String = __LINE__, &) assert_raises

Constructor Detail

def self.new(context : Microtest::ExecutionContext) #

[View source]

Class Method Detail

def self.run_tests(context) : Nil #

NOTE These macro methods are ugly. They contain a lot of duplication, but i don't know how to get rid of it. The duplication seems necessary, since a macro def cannot invoke another macro def. And a macro-level array of method names is required in order to be able to iterate over test method names to generate the "send(...)" like code.


[View source]
def self.test_classes : Array(Test.class) #

[View source]
def self.test_methods : Array(String) #

[View source]
def self.using_focus? : Bool #

[View source]

Instance Method Detail

def after_hooks #

[View source]
def around_hooks(&block) #

[View source]
def before_hooks #

[View source]
def call(name, &block) #

[View source]
def capture_exception(name, &block) #

[View source]
def context : ExecutionContext #

[View source]
def execute_test(name, &block) #

[View source]
def pass #

[View source]
def report_test_result(name, duration, e) #

[View source]

Macro Detail

macro fail(msg) #

[View source]
macro fail(msg, file, line) #

[View source]
macro skip(msg) #

[View source]
macro skip(msg, file, line) #

[View source]