Have the DSL builder produce a test suite
This commit is contained in:
parent
6c5da5a703
commit
38ec35dd29
|
@ -74,9 +74,8 @@ module Spectator
|
||||||
|
|
||||||
# Builds the tests and runs the framework.
|
# Builds the tests and runs the framework.
|
||||||
private def self.run
|
private def self.run
|
||||||
# Build the root-level example group and run it.
|
# Build the test suite and run it.
|
||||||
group = ::Spectator::DSL::Builder.build
|
suite = ::Spectator::DSL::Builder.build
|
||||||
suite = ::Spectator::TestSuite.new(group)
|
|
||||||
Runner.new(suite).run
|
Runner.new(suite).run
|
||||||
rescue ex
|
rescue ex
|
||||||
# Catch all unhandled exceptions here.
|
# Catch all unhandled exceptions here.
|
||||||
|
|
|
@ -91,10 +91,11 @@ module Spectator::DSL
|
||||||
current_group.add_around_each_hook(block)
|
current_group.add_around_each_hook(block)
|
||||||
end
|
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.
|
# This should be called only once after the entire spec has been defined.
|
||||||
protected def build : ExampleGroup
|
protected def build : TestSuite
|
||||||
root_group.build(Internals::SampleValues.empty)
|
group = root_group.build(Internals::SampleValues.empty)
|
||||||
|
TestSuite.new(group)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue