mirror of
https://gitea.invidious.io/iv-org/shard-spectator.git
synced 2024-08-15 00:53:35 +00:00
Should capture a block instead of a value
This commit is contained in:
parent
28680fa849
commit
dd69cec536
1 changed files with 2 additions and 2 deletions
|
@ -70,11 +70,11 @@ module Spectator::DSL
|
|||
# The raw block can't be used because it's not clear to the user.
|
||||
{% method_name = block.body.id.split('.')[1..-1].join('.') %}
|
||||
%partial = %proc.partial(subject)
|
||||
block_actual = ::Spectator::Expectations::ActualValue.new({{"#" + method_name}}, %partial)
|
||||
block_actual = ::Spectator::Expectations::ActualBlock.new({{"#" + method_name}}, %partial)
|
||||
{% else %}
|
||||
# In this case, it looks like the short-hand method syntax wasn't used.
|
||||
# Just drop in the proc as-is.
|
||||
block_actual = ::Spectator::Expectations::ActualValue.new({{"`" + block.body.stringify + "`"}}, %proc)
|
||||
block_actual = ::Spectator::Expectations::ActualBlock.new({{"`" + block.body.stringify + "`"}}, %proc)
|
||||
{% end %}
|
||||
|
||||
source = ::Spectator::Source.new({{_source_file}}, {{_source_line}})
|
||||
|
|
Loading…
Reference in a new issue