mirror of
https://gitea.invidious.io/iv-org/shard-spectator.git
synced 2024-08-15 00:53:35 +00:00
Pass along block only if it exists
This commit is contained in:
parent
a508aeb4a3
commit
4dff018330
1 changed files with 5 additions and 3 deletions
|
@ -52,9 +52,11 @@ module Spectator::DSL
|
|||
# This is important for constructing an instance of the double later.
|
||||
::Spectator::DSL::Mocks::DOUBLES << {name_symbol, context_type_name, double_type_name} %}
|
||||
|
||||
::Spectator::Double.define({{double_type_name}}, {{name}}, {{value_methods.double_splat}}) do
|
||||
{{block.body}}
|
||||
end
|
||||
{% begin %}
|
||||
::Spectator::Double.define({{double_type_name}}, {{name}}, {{value_methods.double_splat}}){% if block %} do
|
||||
{{block.body}}
|
||||
end{% end %}
|
||||
{% end %}
|
||||
{% end %}
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue