mirror of
https://gitea.invidious.io/iv-org/shard-spectator.git
synced 2024-08-15 00:53:35 +00:00
Remove type from group macros
This value is never directly seen, so it isn't necessary to support it.
This commit is contained in:
parent
110a2b2d2a
commit
a82076e2b7
1 changed files with 7 additions and 7 deletions
|
@ -4,12 +4,12 @@ module Spectator
|
|||
module DSL
|
||||
module StructureDSL
|
||||
|
||||
macro describe(what, type = "Describe", &block)
|
||||
context({{what}}, {{type}}) {{block}}
|
||||
macro describe(what, &block)
|
||||
context({{what}}) {{block}}
|
||||
end
|
||||
|
||||
macro context(what, type = "Context", &block)
|
||||
module {{type.id}}%context
|
||||
macro context(what, &block)
|
||||
module Group%group
|
||||
include {{@type.id}}
|
||||
|
||||
::Spectator::Definitions::GROUPS[\{{@type.symbolize}}] =
|
||||
|
@ -27,7 +27,7 @@ module Spectator
|
|||
end
|
||||
|
||||
macro given(collection, &block)
|
||||
module Given%given
|
||||
module Group%group
|
||||
include {{@type.id}}
|
||||
|
||||
def %collection
|
||||
|
@ -46,7 +46,7 @@ module Spectator
|
|||
|
||||
def initialize(locals : Hash(Symbol, ValueWrapper))
|
||||
super
|
||||
@%wrapper = locals[:%given]
|
||||
@%wrapper = locals[:%group]
|
||||
end
|
||||
|
||||
_given_collection Collection%collection, %to_a do
|
||||
|
@ -58,7 +58,7 @@ module Spectator
|
|||
GivenExampleGroup(typeof(%to_a.first)).new(
|
||||
{{collection.stringify}},
|
||||
%to_a,
|
||||
:%given,
|
||||
:%group,
|
||||
::Spectator::Definitions::GROUPS[{{@type.symbolize}}]
|
||||
)
|
||||
|
||||
|
|
Loading…
Reference in a new issue