Example group builder classes should build groups

It's implied in their name.
This commit is contained in:
Michael Miller 2018-09-23 13:40:16 -06:00
parent d551cf6e1b
commit 037fe604ea
3 changed files with 10 additions and 9 deletions

View file

@ -5,6 +5,10 @@ module Spectator
@@group_stack = [::Spectator::DSL::ExampleGroupBuilder.new("ROOT")] @@group_stack = [::Spectator::DSL::ExampleGroupBuilder.new("ROOT")]
private def root_group
@@group_stack.first
end
private def current_group private def current_group
@@group_stack.last @@group_stack.last
end end
@ -53,9 +57,8 @@ module Spectator
current_group.add_around_each_hook(block) current_group.add_around_each_hook(block)
end end
protected def build : Array(Example) protected def build : ExampleGroup
# TODO root_group.build({} of Symbol => ValueWrapper)
[] of Example
end end
end end
end end

View file

@ -35,9 +35,8 @@ module Spectator
@around_each_hooks << block @around_each_hooks << block
end end
def build : Array(Example) def build(locals : Hash(Symbol, ValueWrapper)) : ExampleGroup
# TODO raise NotImplementedError
Array(Example).new
end end
end end
end end

View file

@ -8,9 +8,8 @@ module Spectator
super(what) super(what)
end end
def build : Array(Example) def build(locals : Hash(Symbol, ValueWrapper)) : ExampleGroup
# TODO raise NotImplementedError
Array(Example).new
end end
end end
end end