Spectator::Example
Inherits Spectator::ExampleComponent < Reference < Object
Base class for all types of examples.
Concrete types must implement the #run_impl method.
Constructors
Creates the base of the example. The group should be the example group the example belongs to.
Instance methods
run
Runs the example code. A result is returned, which represents the outcome of the test. An example can be run only once. An exception is raised if an attempt is made to run it more than once.
run_impl
Sourceto_json(json : JSON::Builder)
Creates the JSON representation of the example, which is just its name.
to_s(io)
String representation of the example. This consists of the groups the example is in and the description. The string can be given to end-users to identify the example.