diff --git a/src/spectator/test_suite.cr b/src/spectator/test_suite.cr index 9712173..6392872 100644 --- a/src/spectator/test_suite.cr +++ b/src/spectator/test_suite.cr @@ -3,6 +3,7 @@ module Spectator # Use `#each` to enumerate over all tests in the suite. class TestSuite include Enumerable(Example) + include Iterable(Example) # Creates the test suite. # The example *group* provided will be run. @@ -11,13 +12,13 @@ module Spectator # Yields each example in the test suite. def each : Nil - iterator.each do |example| + each.each do |example| yield example end end - # Creates an iterator for the example group. - private def iterator + # Returns an iterator that yields all examples in the test suite. + def each : Iterator(Example) ExampleIterator.new(@group) end end