diff --git a/src/spectator.cr b/src/spectator.cr index 7fb2aa6..060f3c2 100644 --- a/src/spectator.cr +++ b/src/spectator.cr @@ -74,9 +74,8 @@ module Spectator # Builds the tests and runs the framework. private def self.run - # Build the root-level example group and run it. - group = ::Spectator::DSL::Builder.build - suite = ::Spectator::TestSuite.new(group) + # Build the test suite and run it. + suite = ::Spectator::DSL::Builder.build Runner.new(suite).run rescue ex # Catch all unhandled exceptions here. diff --git a/src/spectator/dsl/builder.cr b/src/spectator/dsl/builder.cr index 189360b..672cb27 100644 --- a/src/spectator/dsl/builder.cr +++ b/src/spectator/dsl/builder.cr @@ -91,10 +91,11 @@ module Spectator::DSL current_group.add_around_each_hook(block) end - # Builds the entire spec and returns it as a group. + # Builds the entire spec and returns it as a test suite. # This should be called only once after the entire spec has been defined. - protected def build : ExampleGroup - root_group.build(Internals::SampleValues.empty) + protected def build : TestSuite + group = root_group.build(Internals::SampleValues.empty) + TestSuite.new(group) end end end