mirror of
https://gitea.invidious.io/iv-org/shard-spectator.git
synced 2024-08-15 00:53:35 +00:00
Some test creation rewrite
This commit is contained in:
parent
1c5b46b981
commit
f25eb9164f
1 changed files with 6 additions and 3 deletions
|
@ -1416,17 +1416,20 @@ module Spectator::DSL
|
||||||
# Create the wrapper class for the test code.
|
# Create the wrapper class for the test code.
|
||||||
{% if block.is_a?(Nop) %}
|
{% if block.is_a?(Nop) %}
|
||||||
{% if what.is_a?(Call) %}
|
{% if what.is_a?(Call) %}
|
||||||
_spectator_test(Test%example, %run) do
|
def %run
|
||||||
{{what}}
|
{{what}}
|
||||||
end
|
end
|
||||||
{% else %}
|
{% else %}
|
||||||
{% raise "Unrecognized syntax: `it #{what}`" %}
|
{% raise "Unrecognized syntax: `it #{what}`" %}
|
||||||
{% end %}
|
{% end %}
|
||||||
{% else %}
|
{% else %}
|
||||||
_spectator_test(Test%example, %run) {{block}}
|
def %run
|
||||||
|
{{block}}
|
||||||
|
end
|
||||||
{% end %}
|
{% end %}
|
||||||
|
|
||||||
# TODO
|
%source = ::Spectator::Source.new({{_source_file}}, {{_source_line}})
|
||||||
|
::Spectator::DSL::Builder.add_example({{what.stringify}}, %source, {{@type.name}}) { |test| test.as({{@type.name}}).%run }
|
||||||
end
|
end
|
||||||
|
|
||||||
# Creates an example, or a test case.
|
# Creates an example, or a test case.
|
||||||
|
|
Loading…
Reference in a new issue