Create test instance when example is created

This exposes errors in the framework
instead of delaying them until the test runs.
This commit is contained in:
Michael Miller 2018-09-23 14:39:05 -06:00
parent 94e2f54713
commit 03a8efd7f8

View file

@ -155,8 +155,13 @@ module Spectator
end end
class Example%example < ::Spectator::RunnableExample class Example%example < ::Spectator::RunnableExample
def initialize(group : ::Spectator::ExampleGroup, locals : Hash(Symbol, ::Spectator::ValueWrapper))
super
@instance = Wrapper%example.new(locals)
end
protected def run_instance protected def run_instance
Wrapper%example.new(locals).%run @instance.%run
end end
def description def description