Merge branch 'master' into mock-redesign

This commit is contained in:
Michael Miller 2022-02-28 20:39:33 -07:00
commit 0ea7890ece
No known key found for this signature in database
GPG key ID: AC78B32D30CE34A2
7 changed files with 101 additions and 7 deletions

View file

@ -101,9 +101,15 @@ module Spectator::DSL
)
\{% if block %}
\{% for arg, i in block.args %}
let(\{{arg}}) do |example|
example.group.as(::Spectator::ExampleGroupIteration(typeof(Group\%group.\%collection.first))).item[\{{i}}]
\{% if block.args.size > 1 %}
\{% for arg, i in block.args %}
let(\{{arg}}) do |example|
example.group.as(::Spectator::ExampleGroupIteration(typeof(Group\%group.\%collection.first))).item[\{{i}}]
end
\{% end %}
\{% else %}
let(\{{block.args[0]}}) do |example|
example.group.as(::Spectator::ExampleGroupIteration(typeof(Group\%group.\%collection.first))).item
end
\{% end %}

View file

@ -283,6 +283,12 @@ module Spectator
# Allow instance to behave like an example.
forward_missing_to @example
# Constructs the full name or description of the example.
# This prepends names of groups this example is part of.
def to_s(io) : Nil
@example.to_s(io)
end
end
end
end