module Spectator::DSL::Builder
Overview
Incrementally builds up a test spec from the DSL. This is intended to be used only by the Spectator DSL.
Extended Modules
Defined in:
spectator/dsl/builder.crInstance Method Summary
-
#add_example(*args, &block : Example -> )
Defines a new example.
-
#add_pending_example(*args)
Defines a new pending example.
-
#after_all(location = nil, label = "after_all", &block)
Defines a block of code to execute after any and all examples in the current group.
-
#after_each(location = nil, label = "after_each", &block : Example -> )
Defines a block of code to execute after every example in the current group.
-
#after_suite(location = nil, label = "after_suite", &block)
Defines a block of code to execute after any and all examples in the test suite.
-
#around_each(location = nil, label = "around_each", &block : Example::Procsy -> )
Defines a block of code to execute around every example in the current group.
-
#before_all(location = nil, label = "before_all", &block)
Defines a block of code to execute before any and all examples in the current group.
-
#before_each(location = nil, label = "before_each", &block : Example -> _)
Defines a block of code to execute before every example in the current group
-
#before_suite(location = nil, label = "before_suite", &block)
Defines a block of code to execute before any and all examples in the test suite.
-
#build : Spec
Constructs the test spec.
-
#end_group(*args)
Completes a previously defined example group and pops it off the group stack.
-
#post_condition(location = nil, label = "post_condition", &block : Example -> )
Defines a block of code to execute after every example in the current group.
-
#pre_condition(location = nil, label = "pre_condition", &block : Example -> _)
Defines a block of code to execute before every example in the current group
-
#start_group(*args)
Defines a new example group and pushes it onto the group stack.
-
#start_iterative_group(*args)
Defines a new iterative example group and pushes it onto the group stack.
Instance Method Detail
Defines a new example. The example is added to the group currently on the top of the stack.
See Spec::Builder#add_example
for usage details.
Defines a new pending example. The example is added to the group currently on the top of the stack.
See Spec::Builder#add_pending_example
for usage details.
Defines a block of code to execute after any and all examples in the current group.
Defines a block of code to execute after every example in the current group.
Defines a block of code to execute after any and all examples in the test suite.
Defines a block of code to execute around every example in the current group.
Defines a block of code to execute before any and all examples in the current group.
Defines a block of code to execute before every example in the current group
Defines a block of code to execute before any and all examples in the test suite.
Constructs the test spec. Returns the spec instance.
Raises an error if there were not symmetrical calls to #start_group
and #end_group
.
This would indicate a logical error somewhere in Spectator or an extension of it.
Completes a previously defined example group and pops it off the group stack.
Be sure to call #start_group
and #end_group
symmetrically.
See Spec::Builder#end_group
for usage details.
Defines a block of code to execute after every example in the current group.
Defines a block of code to execute before every example in the current group
Defines a new example group and pushes it onto the group stack.
Examples and groups defined after calling this method will be nested under the new group.
The group will be finished and popped off the stack when #end_example
is called.
See Spec::Builder#start_group
for usage details.
Defines a new iterative example group and pushes it onto the group stack.
Examples and groups defined after calling this method will be nested under the new group.
The group will be finished and popped off the stack when #end_example
is called.
See Spec::Builder#start_iterative_group
for usage details.