abstract class Testify::Test
- Testify::Test
- Reference
- Object
Overview
Test class is equivalent of describe
block (internally it's a mapping).
It is an alternative DSL (Spec compliant)
for creating unit and integration tests.
Any tests defined within a parent class will run for each child test case (by inheritance).
Macros, abstract def
, super
and other OOP features can be used as well to reduce duplication.
Some additional features are also built in, such as the Data
annotation and Tracker
module.
See README for more details and examples.
Defined in:
testify.crClass Method Summary
Instance Method Summary
-
#after_all : Nil
Method executed after the last test in the current class runs.
-
#after_each : Nil
Method executed after each test in the current class runs.
-
#around_all(procsy) : Nil
Method executed when the current class runs.
-
#around_each(procsy) : Nil
Method executed when each test in the current class runs.
-
#before_all : Nil
Method executed before the first test in the current class runs.
-
#before_each : Nil
Method executed before each test in the current class runs.
Class Method Detail
Runs the tests contained in the current Test
class.
SeeTestify.run_all
to run all tests contained in all theTest
classes.
Instance Method Detail
Method executed after the last test in the current class runs.
class ExampleTest < Testify::Test
def after_all : Nil
puts "after_all"
end
end
Method executed after each test in the current class runs.
class ExampleTest < Testify::Test
def after_each : Nil
puts "after_each"
end
end
Method executed when the current class runs.
class ExampleTest < Testify::Test
def around_all(test) : Nil
puts "around_all: before"
test.run
puts "around_all: after"
end
end
Method executed when each test in the current class runs.
class ExampleTest < Testify::Test
def around_each(test) : Nil
puts "around_each: before"
test.run
puts "around_each: after"
end
end
Method executed before the first test in the current class runs.
class ExampleTest < Testify::Test
def before_all : Nil
puts "before_all"
end
end
Method executed before each test in the current class runs.
class ExampleTest < Testify::Test
def before_each : Nil
puts "before_each"
end
end