Concat #all_examples instead of recursive #add_examples

This commit is contained in:
Michael Miller 2018-09-19 22:28:20 -06:00
parent 4d601281f6
commit aaf973b8cf

View file

@ -95,12 +95,12 @@ module Spectator
-> { inner.call(wrapper) }
end
protected def add_examples(array : Array(Example))
def add_examples(array : Array(Example))
@children.each do |child|
if child.is_a?(ExampleFactory)
array << child.build
else
child.add_examples(array)
array.concat(child.all_examples)
end
end
end