mirror of
https://gitea.invidious.io/iv-org/shard-spectator.git
synced 2024-08-15 00:53:35 +00:00
Handle case of missing block body for #given better
This commit is contained in:
parent
8297152c36
commit
046d946669
1 changed files with 3 additions and 1 deletions
|
@ -402,7 +402,9 @@ module Spectator::DSL
|
||||||
# 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.body.is_a?(Expressions)
|
body = if block.is_a?(Nop)
|
||||||
|
raise "Missing body for given block"
|
||||||
|
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
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue