mirror of
https://gitea.invidious.io/iv-org/shard-spectator.git
synced 2024-08-15 00:53:35 +00:00
Make Example#group abstract
Instead of passing parent group as an argument, define the group method in the exapmle class created by the #it macro.
This commit is contained in:
parent
0f7640411f
commit
bb7f036a82
2 changed files with 6 additions and 6 deletions
|
@ -140,10 +140,13 @@ module Spectator
|
|||
def description
|
||||
{{description.is_a?(StringLiteral) ? description : description.stringify}}
|
||||
end
|
||||
|
||||
def group
|
||||
::Spectator::Definitions::GROUPS[{{@type.symbolize}}]
|
||||
end
|
||||
end
|
||||
|
||||
%group = ::Spectator::Definitions::GROUPS[\{{@type.symbolize}}]
|
||||
%group.children << Example%example.new(%group)
|
||||
::Spectator::Definitions::GROUPS[\{{@type.symbolize}}].children << Example%example.new
|
||||
end
|
||||
|
||||
macro pending(description, &block)
|
||||
|
|
|
@ -1,12 +1,9 @@
|
|||
module Spectator
|
||||
abstract class Example
|
||||
getter group : ExampleGroup
|
||||
getter? finished = false
|
||||
|
||||
def initialize(@group)
|
||||
end
|
||||
|
||||
abstract def run : Result
|
||||
abstract def description : String
|
||||
abstract def group : ExampleGroup
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue