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)
|
def initialize(@example_type : Example.class)
|
||||||
end
|
end
|
||||||
|
|
||||||
def build(locals : Hash(Symbol, ValueWrapper)) : Example
|
def build(group : ExampleGroup, locals : Hash(Symbol, ValueWrapper)) : Example
|
||||||
@example_type.new(locals)
|
@example_type.new(group, locals)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -159,10 +159,6 @@ module Spectator
|
||||||
def description
|
def description
|
||||||
{{description.is_a?(StringLiteral) ? description : description.stringify}}
|
{{description.is_a?(StringLiteral) ? description : description.stringify}}
|
||||||
end
|
end
|
||||||
|
|
||||||
def group
|
|
||||||
nil # TODO
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
::Spectator::DSL::Builder.add_example(Example%example)
|
::Spectator::DSL::Builder.add_example(Example%example)
|
||||||
|
|
|
@ -1,12 +1,12 @@
|
||||||
module Spectator
|
module Spectator
|
||||||
abstract class Example
|
abstract class Example
|
||||||
getter? finished = false
|
getter? finished = false
|
||||||
|
getter group : ExampleGroup
|
||||||
|
|
||||||
abstract def run : Result
|
abstract def run : Result
|
||||||
abstract def description : String
|
abstract def description : String
|
||||||
abstract def group : ExampleGroup
|
|
||||||
|
|
||||||
def initialize(@locals = {} of Symbol => ValueWrapper)
|
def initialize(@group, @locals = {} of Symbol => ValueWrapper)
|
||||||
end
|
end
|
||||||
|
|
||||||
private getter locals
|
private getter locals
|
||||||
|
|
Loading…
Reference in a new issue