mirror of
https://gitea.invidious.io/iv-org/shard-spectator.git
synced 2024-08-15 00:53:35 +00:00
Pass group to example initializer
This commit is contained in:
parent
09184f4a2a
commit
ecba0d00ec
3 changed files with 4 additions and 8 deletions
|
@ -4,8 +4,8 @@ module Spectator
|
|||
def initialize(@example_type : Example.class)
|
||||
end
|
||||
|
||||
def build(locals : Hash(Symbol, ValueWrapper)) : Example
|
||||
@example_type.new(locals)
|
||||
def build(group : ExampleGroup, locals : Hash(Symbol, ValueWrapper)) : Example
|
||||
@example_type.new(group, locals)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -159,10 +159,6 @@ module Spectator
|
|||
def description
|
||||
{{description.is_a?(StringLiteral) ? description : description.stringify}}
|
||||
end
|
||||
|
||||
def group
|
||||
nil # TODO
|
||||
end
|
||||
end
|
||||
|
||||
::Spectator::DSL::Builder.add_example(Example%example)
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
module Spectator
|
||||
abstract class Example
|
||||
getter? finished = false
|
||||
getter group : ExampleGroup
|
||||
|
||||
abstract def run : Result
|
||||
abstract def description : String
|
||||
abstract def group : ExampleGroup
|
||||
|
||||
def initialize(@locals = {} of Symbol => ValueWrapper)
|
||||
def initialize(@group, @locals = {} of Symbol => ValueWrapper)
|
||||
end
|
||||
|
||||
private getter locals
|
||||
|
|
Loading…
Reference in a new issue