Dumb auto-format

This commit is contained in:
Michael Miller 2019-09-26 16:25:43 -06:00
parent e3e4cac9c1
commit edabaa9447

View file

@ -114,21 +114,19 @@ module Spectator
let({{assignment.target}}) { {{assignment.value}} }
{% end %}
{%
# Trick to get the contents of the block as an array of nodes.
# If there are multiple expressions/statements in the block,
# then the body will be a `Expressions` type.
# If there's only one expression, then the body is just that.
body = if block.is_a?(Nop)
raise "Missing block for 'given'"
elsif block.body.is_a?(Expressions)
# Get the expressions, which is already an array.
block.body.expressions
else
# Wrap the expression in an array.
[block.body]
end
%}
{% # Trick to get the contents of the block as an array of nodes.
# If there are multiple expressions/statements in the block,
# then the body will be a `Expressions` type.
# If there's only one expression, then the body is just that.
body = if block.is_a?(Nop)
raise "Missing block for 'given'"
elsif block.body.is_a?(Expressions)
# Get the expressions, which is already an array.
block.body.expressions
else
# Wrap the expression in an array.
[block.body]
end %}
{% for item in body %}
# If the item starts with "it", then leave it as-is.