shard-spectator/src/spectator/example.cr
Michael Miller a9d4acda36 Pass locals to example and test wrapper initializer
The #initialize method is defined in each context/given/module
that needs to add a local.
This is an elegant (although possibly confusing) solution.
2018-09-21 14:03:09 -06:00

14 lines
283 B
Crystal

module Spectator
abstract class Example
getter? finished = false
abstract def run : Result
abstract def description : String
abstract def group : ExampleGroup
def initialize(@locals = {} of Symbol => ValueWrapper)
end
private getter locals
end
end