shard-spectator/src/spectator/example_component.cr
Michael Miller bcb68a5856 Implement example lookup by index
This will be used later for executing tests in random order.
2018-10-14 19:06:02 -06:00

17 lines
563 B
Crystal

module Spectator
# Abstract base for all examples and collections of examples.
# This is used as the base node type for the composite design pattern.
abstract class ExampleComponent
# Text that describes the context or test.
abstract def what : String
# Indicates whether the example (or group) has been completely run.
abstract def finished? : Bool
# The number of examples in this instance.
abstract def example_count : Int
# Lookup the example with the specified index.
abstract def [](index : Int) : Example
end
end