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 DSL
|
||||||
module StructureDSL
|
module StructureDSL
|
||||||
|
|
||||||
macro describe(what, type = "Describe", &block)
|
macro describe(what, &block)
|
||||||
context({{what}}, {{type}}) {{block}}
|
context({{what}}) {{block}}
|
||||||
end
|
end
|
||||||
|
|
||||||
macro context(what, type = "Context", &block)
|
macro context(what, &block)
|
||||||
module {{type.id}}%context
|
module Group%group
|
||||||
include {{@type.id}}
|
include {{@type.id}}
|
||||||
|
|
||||||
::Spectator::Definitions::GROUPS[\{{@type.symbolize}}] =
|
::Spectator::Definitions::GROUPS[\{{@type.symbolize}}] =
|
||||||
|
@ -27,7 +27,7 @@ module Spectator
|
||||||
end
|
end
|
||||||
|
|
||||||
macro given(collection, &block)
|
macro given(collection, &block)
|
||||||
module Given%given
|
module Group%group
|
||||||
include {{@type.id}}
|
include {{@type.id}}
|
||||||
|
|
||||||
def %collection
|
def %collection
|
||||||
|
@ -46,7 +46,7 @@ module Spectator
|
||||||
|
|
||||||
def initialize(locals : Hash(Symbol, ValueWrapper))
|
def initialize(locals : Hash(Symbol, ValueWrapper))
|
||||||
super
|
super
|
||||||
@%wrapper = locals[:%given]
|
@%wrapper = locals[:%group]
|
||||||
end
|
end
|
||||||
|
|
||||||
_given_collection Collection%collection, %to_a do
|
_given_collection Collection%collection, %to_a do
|
||||||
|
@ -58,7 +58,7 @@ module Spectator
|
||||||
GivenExampleGroup(typeof(%to_a.first)).new(
|
GivenExampleGroup(typeof(%to_a.first)).new(
|
||||||
{{collection.stringify}},
|
{{collection.stringify}},
|
||||||
%to_a,
|
%to_a,
|
||||||
:%given,
|
:%group,
|
||||||
::Spectator::Definitions::GROUPS[{{@type.symbolize}}]
|
::Spectator::Definitions::GROUPS[{{@type.symbolize}}]
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue