Start reactivating runner

This commit is contained in:
Michael Miller 2020-09-27 09:10:27 -06:00
parent 579fcacfde
commit ec6018bed4
No known key found for this signature in database
GPG key ID: F9A0C5C65B162436
3 changed files with 20 additions and 3 deletions

View file

@ -93,8 +93,8 @@ module Spectator
# Builds the tests and runs the framework. # Builds the tests and runs the framework.
private def run private def run
# Build the test suite and run it. # Build the test spec and run it.
# suite = ::Spectator::SpecBuilder.build(config.example_filter) spec = ::Spectator::DSL::Builder.build
# Runner.new(suite, config).run # Runner.new(suite, config).run
true true
rescue ex rescue ex

View file

@ -28,6 +28,8 @@ module Spectator
# Returns the result of the execution. # Returns the result of the execution.
# The result will also be stored in `#result`. # The result will also be stored in `#result`.
def run : Result def run : Result
Spectator.debug_out("Running example #{example}")
@delegate.call(self)
raise NotImplementedError.new("#run") raise NotImplementedError.new("#run")
end end

View file

@ -1,6 +1,21 @@
require "./spec/*" require "./example"
require "./example_group"
module Spectator module Spectator
class Spec class Spec
include Enumerable(Example)
def initialize(@group : ExampleGroup)
end
def each
@group.each do |node|
if (example = node.as?(Example))
yield example
elsif (group = node.as?(ExampleGroup))
# TODO
end
end
end
end end
end end