Change example wrapper type to a class

Fixes issue #11.
Variables (defined with let) were getting re-created between the hooks 
and the example code.
This was due to a separate struct value being returned for each fetch to 
the wrapped example instance.
In turn, the wrappers for variables were reset for each fetch.
This commit is contained in:
Michael Miller 2019-06-01 20:10:08 -06:00
parent ed2614da22
commit ca564619ad

View file

@ -1537,7 +1537,7 @@ module Spectator::DSL
# The block passed to this macro is the actual test code.
private macro _spectator_test(class_name, run_method_name)
# Wrapper class for isolating the test code.
struct {{class_name.id}}
class {{class_name.id}}
# Mix in methods and macros specifically for example DSL.
include ::Spectator::DSL::ExampleDSL