mirror of
https://gitea.invidious.io/iv-org/shard-spectator.git
synced 2024-08-15 00:53:35 +00:00
Prevent defining an example or group in a test
This commit is contained in:
parent
99a9d7960a
commit
4567162459
2 changed files with 4 additions and 0 deletions
|
@ -5,6 +5,8 @@ module Spectator::DSL
|
||||||
module Examples
|
module Examples
|
||||||
macro define_example(name)
|
macro define_example(name)
|
||||||
macro {{name.id}}(what = nil, &block)
|
macro {{name.id}}(what = nil, &block)
|
||||||
|
\{% raise "Cannot use '{{name.id}}' inside of a test block" if @def %}
|
||||||
|
|
||||||
def %test
|
def %test
|
||||||
\{{block.body}}
|
\{{block.body}}
|
||||||
end
|
end
|
||||||
|
|
|
@ -11,6 +11,8 @@ module Spectator::DSL
|
||||||
#
|
#
|
||||||
# TODO: Handle string interpolation in example and group names.
|
# TODO: Handle string interpolation in example and group names.
|
||||||
macro {{name.id}}(what, &block)
|
macro {{name.id}}(what, &block)
|
||||||
|
\{% raise "Cannot use '{{name.id}}' inside of a test block" if @def %}
|
||||||
|
|
||||||
class Group%group < \{{@type.id}}
|
class Group%group < \{{@type.id}}
|
||||||
_spectator_group_subject(\{{what}})
|
_spectator_group_subject(\{{what}})
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue