mirror of
https://gitea.invidious.io/iv-org/shard-spectator.git
synced 2024-08-15 00:53:35 +00:00
Add spec for test suite
This commit is contained in:
parent
493e30acee
commit
6151912fa6
1 changed files with 18 additions and 0 deletions
18
spec/test_suite_spec.cr
Normal file
18
spec/test_suite_spec.cr
Normal file
|
@ -0,0 +1,18 @@
|
|||
require "./spec_helper"
|
||||
|
||||
describe Spectator::TestSuite do
|
||||
describe "#each" do
|
||||
it "yields each example" do
|
||||
group = Spectator::RootExampleGroup.new(Spectator::ExampleHooks.empty, Spectator::ExampleConditions.empty)
|
||||
group.children = Array.new(5) do |index|
|
||||
PassingExample.new(group, Spectator::Internals::SampleValues.empty).as(Spectator::ExampleComponent)
|
||||
end
|
||||
test_suite = Spectator::TestSuite.new(group)
|
||||
examples = [] of Spectator::Example
|
||||
test_suite.each do |example|
|
||||
examples << example
|
||||
end
|
||||
examples.should eq(group.children)
|
||||
end
|
||||
end
|
||||
end
|
Loading…
Reference in a new issue