Upcast context to reduce method instances generated by compiler

This commit is contained in:
Michael Miller 2020-11-08 16:52:08 -07:00
parent f433405ece
commit b8dc83286c
No known key found for this signature in database
GPG key ID: F9A0C5C65B162436

View file

@ -19,8 +19,8 @@ module Spectator::DSL
::Spectator::DSL::Builder.add_example(
_spectator_example_name(\{{what}}),
::Spectator::Source.new(\{{block.filename}}, \{{block.line_number}}),
\{{@type.name}}.new
) { |example, context| context.as(\{{@type.name}}).\%test }
\{{@type.name}}.new.as(::Spectator::Context)
end
end