module

Spectator::DSL::Builder

Incrementally builds up a test spec from the DSL. This is intended to be used only by the Spectator DSL.

Instance methods

add_example(*args, &block : Example -> )

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.

Source
add_pending_example(*args)

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.

Source
after_all(location = nil, label = "after_all", &block)

Defines a block of code to execute after any and all examples in the current group.

Source
after_each(location = nil, label = "after_each", &block : Example -> )

Defines a block of code to execute after every example in the current group.

Source
after_suite(location = nil, label = "after_suite", &block)

Defines a block of code to execute after any and all examples in the test suite.

Source
around_each(location = nil, label = "around_each", &block : Example::Procsy -> )

Defines a block of code to execute around every example in the current group.

Source
before_all(location = nil, label = "before_all", &block)

Defines a block of code to execute before any and all examples in the current group.

Source
before_each(location = nil, label = "before_each", &block : Example -> _)

Defines a block of code to execute before every example in the current group

Source
before_suite(location = nil, label = "before_suite", &block)

Defines a block of code to execute before any and all examples in the test suite.

Source
build

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.

Source
end_group(*args)

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.

Source
post_condition(location = nil, label = "post_condition", &block : Example -> )

Defines a block of code to execute after every example in the current group.

Source
pre_condition(location = nil, label = "pre_condition", &block : Example -> _)

Defines a block of code to execute before every example in the current group

Source
start_group(*args)

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.

Source
start_iterative_group(*args)

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.

Source