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
|
def description
|
||||||
{{description.is_a?(StringLiteral) ? description : description.stringify}}
|
{{description.is_a?(StringLiteral) ? description : description.stringify}}
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def group
|
||||||
|
::Spectator::Definitions::GROUPS[{{@type.symbolize}}]
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
%group = ::Spectator::Definitions::GROUPS[\{{@type.symbolize}}]
|
::Spectator::Definitions::GROUPS[\{{@type.symbolize}}].children << Example%example.new
|
||||||
%group.children << Example%example.new(%group)
|
|
||||||
end
|
end
|
||||||
|
|
||||||
macro pending(description, &block)
|
macro pending(description, &block)
|
||||||
|
|
|
@ -1,12 +1,9 @@
|
||||||
module Spectator
|
module Spectator
|
||||||
abstract class Example
|
abstract class Example
|
||||||
getter group : ExampleGroup
|
|
||||||
getter? finished = false
|
getter? finished = false
|
||||||
|
|
||||||
def initialize(@group)
|
|
||||||
end
|
|
||||||
|
|
||||||
abstract def run : Result
|
abstract def run : Result
|
||||||
abstract def description : String
|
abstract def description : String
|
||||||
|
abstract def group : ExampleGroup
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue