From 9269cbd6cc6d8b2c4700f65a8eff3a40eb740523 Mon Sep 17 00:00:00 2001 From: Michael Miller Date: Wed, 31 Mar 2021 16:24:52 -0600 Subject: [PATCH] Remove references to ExampleGroup --- src/spectator/example_iterator.cr | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/spectator/example_iterator.cr b/src/spectator/example_iterator.cr index abcfd33..36b2cfd 100644 --- a/src/spectator/example_iterator.cr +++ b/src/spectator/example_iterator.cr @@ -1,5 +1,4 @@ require "./example" -require "./example_group" require "./spec/node" module Spectator @@ -13,7 +12,7 @@ module Spectator # Creates a new iterator. # The *group* is the example group to iterate through. - def initialize(@group : ExampleGroup) + def initialize(@group : Iterable(Spec::Node)) iter = @group.each.as(Iterator(Spec::Node)) @stack = [iter] end @@ -49,13 +48,14 @@ module Spectator @stack.last end - # Retrieves the next "thing" from the tree. - # This method will return an `Example` or "something else." + # Retrieves the next node from the tree. + # This method will return an `Example` or some other type of node. + # If the node is iterable, it is pushed onto the stack before returning it. private def advance # Get the iterator from the top of the stack. # Advance the iterator and check what the next item is. case (item = top.next) - when ExampleGroup + when Iterable(Spec::Node) # If the next thing is a group, # we need to traverse its branch. # Push its iterator onto the stack and return.