This commit is contained in:
Michael Miller 2019-02-10 23:05:16 -07:00
parent 55b655e90a
commit 3d67c45a22

View file

@ -1,17 +1,22 @@
module Spectator
# Encapsulates the tests to run and additional properties about them.
# Use `#each` to enumerate over all tests in the suite.
class TestSuite
include Enumerable(Example)
# Creates the test suite.
# The example `group` provided will be run.
def initialize(@group : ExampleGroup)
end
def each
# Yields each example in the test suite.
def each : Nil
iterator.each do |example|
yield example
end
end
# Creates an iterator for the example group.
private def iterator
ExampleIterator.new(@group)
end