mirror of
https://gitea.invidious.io/iv-org/shard-spectator.git
synced 2024-08-15 00:53:35 +00:00
Add examples to group children
This commit is contained in:
parent
06630e87d3
commit
2be9d65997
1 changed files with 6 additions and 3 deletions
|
@ -95,7 +95,7 @@ module Spectator
|
||||||
end
|
end
|
||||||
|
|
||||||
macro it(description, &block)
|
macro it(description, &block)
|
||||||
class Example%example
|
class Wrapper%example
|
||||||
include ::Spectator::DSL::ExampleDSL
|
include ::Spectator::DSL::ExampleDSL
|
||||||
include {{@type.id}}
|
include {{@type.id}}
|
||||||
|
|
||||||
|
@ -104,15 +104,18 @@ module Spectator
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
class Wrapper%wrapper < ::Spectator::RunnableExample
|
class Example%example < ::Spectator::RunnableExample
|
||||||
protected def run_instance
|
protected def run_instance
|
||||||
Example%example.new.%run
|
Wrapper%example.new.%run
|
||||||
end
|
end
|
||||||
|
|
||||||
def description
|
def description
|
||||||
{{description.is_a?(StringLiteral) ? description : description.stringify}}
|
{{description.is_a?(StringLiteral) ? description : description.stringify}}
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
%group = ::Spectator::Definitions::GROUPS[{{@type.stringify}}]
|
||||||
|
%group.children << Example%example.new(%group)
|
||||||
end
|
end
|
||||||
|
|
||||||
macro pending(description, &block)
|
macro pending(description, &block)
|
||||||
|
|
Loading…
Reference in a new issue