mirror of
https://gitea.invidious.io/iv-org/shard-spectator.git
synced 2024-08-15 00:53:35 +00:00
Remove references to ExampleGroup
This commit is contained in:
parent
bf17bc95ac
commit
9269cbd6cc
1 changed files with 5 additions and 5 deletions
|
@ -1,5 +1,4 @@
|
||||||
require "./example"
|
require "./example"
|
||||||
require "./example_group"
|
|
||||||
require "./spec/node"
|
require "./spec/node"
|
||||||
|
|
||||||
module Spectator
|
module Spectator
|
||||||
|
@ -13,7 +12,7 @@ module Spectator
|
||||||
|
|
||||||
# Creates a new iterator.
|
# Creates a new iterator.
|
||||||
# The *group* is the example group to iterate through.
|
# 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))
|
iter = @group.each.as(Iterator(Spec::Node))
|
||||||
@stack = [iter]
|
@stack = [iter]
|
||||||
end
|
end
|
||||||
|
@ -49,13 +48,14 @@ module Spectator
|
||||||
@stack.last
|
@stack.last
|
||||||
end
|
end
|
||||||
|
|
||||||
# Retrieves the next "thing" from the tree.
|
# Retrieves the next node from the tree.
|
||||||
# This method will return an `Example` or "something else."
|
# 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
|
private def advance
|
||||||
# Get the iterator from the top of the stack.
|
# Get the iterator from the top of the stack.
|
||||||
# Advance the iterator and check what the next item is.
|
# Advance the iterator and check what the next item is.
|
||||||
case (item = top.next)
|
case (item = top.next)
|
||||||
when ExampleGroup
|
when Iterable(Spec::Node)
|
||||||
# If the next thing is a group,
|
# If the next thing is a group,
|
||||||
# we need to traverse its branch.
|
# we need to traverse its branch.
|
||||||
# Push its iterator onto the stack and return.
|
# Push its iterator onto the stack and return.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue