diff --git a/spec/test_suite_spec.cr b/spec/test_suite_spec.cr new file mode 100644 index 0000000..22f7372 --- /dev/null +++ b/spec/test_suite_spec.cr @@ -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