Add examples to group children

This commit is contained in:
Michael Miller 2018-09-19 19:32:59 -06:00
parent 06630e87d3
commit 2be9d65997

View file

@ -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)