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