mirror of
https://gitea.invidious.io/iv-org/shard-spectator.git
synced 2024-08-15 00:53:35 +00:00
Fix generating source from brace-less examples.
Addresses https://github.com/icy-arctic-fox/spectator/issues/20
This commit is contained in:
parent
eee5d3888d
commit
8d48e441b2
1 changed files with 10 additions and 2 deletions
|
@ -18,7 +18,11 @@ module Spectator
|
|||
end
|
||||
{% end %}
|
||||
|
||||
%source = ::Spectator::Source.new({{block.filename}}, {{block.line_number}})
|
||||
{% if block.is_a?(Nop) %}
|
||||
%source = ::Spectator::Source.new({{description.filename}}, {{description.line_number}})
|
||||
{% else %}
|
||||
%source = ::Spectator::Source.new({{block.filename}}, {{block.line_number}})
|
||||
{% end %}
|
||||
::Spectator::SpecBuilder.add_example(
|
||||
{{description.is_a?(StringLiteral) || description.is_a?(StringInterpolation) || description.is_a?(NilLiteral) ? description : description.stringify}},
|
||||
%source,
|
||||
|
@ -45,7 +49,11 @@ module Spectator
|
|||
end
|
||||
{% end %}
|
||||
|
||||
%source = ::Spectator::Source.new({{block.filename}}, {{block.line_number}})
|
||||
{% if block.is_a?(Nop) %}
|
||||
%source = ::Spectator::Source.new({{description.filename}}, {{description.line_number}})
|
||||
{% else %}
|
||||
%source = ::Spectator::Source.new({{block.filename}}, {{block.line_number}})
|
||||
{% end %}
|
||||
::Spectator::SpecBuilder.add_pending_example(
|
||||
{{description.is_a?(StringLiteral) || description.is_a?(StringInterpolation) || description.is_a?(NilLiteral) ? description : description.stringify}},
|
||||
%source,
|
||||
|
|
Loading…
Reference in a new issue