class Spectator::NodeIterator

Overview

Iterates through all nodes in a group and its nested groups. Nodes are iterated in pre-order.

Included Modules

Defined in:

spectator/node_iterator.cr

Constructors

Instance Method Summary

Instance methods inherited from class Object

should(matcher : Spectator::Matchers::TypeMatcher(U), message = nil, *, _file = __FILE__, _line = __LINE__) forall U
should(matcher, message = nil, *, _file = __FILE__, _line = __LINE__)
should
, should_eventually(matcher, message = nil, *, _file = __FILE__, _line = __LINE__) should_eventually, should_never(matcher, message = nil, *, _file = __FILE__, _line = __LINE__) should_never, should_not(matcher : Spectator::Matchers::TypeMatcher(U), message = nil, *, _file = __FILE__, _line = __LINE__) forall U
should_not(matcher : Spectator::Matchers::NilMatcher, message = nil, *, _file = __FILE__, _line = __LINE__)
should_not(matcher, message = nil, *, _file = __FILE__, _line = __LINE__)
should_not

Constructor Detail

def self.new(group : Node) #

Creates a new iterator. The group is the example group to iterate through.


[View source]

Instance Method Detail

def next #

Retrieves the next Node. If there are none left, then Iterator::Stop is returned.


[View source]
def rewind #

Restart the iterator at the beginning.


[View source]