mirror of
https://gitea.invidious.io/iv-org/shard-spectator.git
synced 2024-08-15 00:53:35 +00:00
Add docs
This commit is contained in:
parent
55b655e90a
commit
3d67c45a22
1 changed files with 6 additions and 1 deletions
|
@ -1,17 +1,22 @@
|
||||||
module Spectator
|
module Spectator
|
||||||
# Encapsulates the tests to run and additional properties about them.
|
# Encapsulates the tests to run and additional properties about them.
|
||||||
|
# Use `#each` to enumerate over all tests in the suite.
|
||||||
class TestSuite
|
class TestSuite
|
||||||
include Enumerable(Example)
|
include Enumerable(Example)
|
||||||
|
|
||||||
|
# Creates the test suite.
|
||||||
|
# The example `group` provided will be run.
|
||||||
def initialize(@group : ExampleGroup)
|
def initialize(@group : ExampleGroup)
|
||||||
end
|
end
|
||||||
|
|
||||||
def each
|
# Yields each example in the test suite.
|
||||||
|
def each : Nil
|
||||||
iterator.each do |example|
|
iterator.each do |example|
|
||||||
yield example
|
yield example
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# Creates an iterator for the example group.
|
||||||
private def iterator
|
private def iterator
|
||||||
ExampleIterator.new(@group)
|
ExampleIterator.new(@group)
|
||||||
end
|
end
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue