mirror of
https://gitea.invidious.io/iv-org/shard-spectator.git
synced 2024-08-15 00:53:35 +00:00
Add symbol for getting local from #given
This commit is contained in:
parent
3c31783fd7
commit
56ae92a25d
2 changed files with 4 additions and 3 deletions
|
@ -4,7 +4,7 @@ module Spectator
|
|||
module DSL
|
||||
class GivenExampleGroupBuilder < ExampleGroupBuilder
|
||||
|
||||
def initialize(what : String, @collection : Array(ValueWrapper))
|
||||
def initialize(what : String, @collection : Array(ValueWrapper), @symbol : Symbol)
|
||||
super(what)
|
||||
end
|
||||
|
||||
|
@ -12,7 +12,7 @@ module Spectator
|
|||
ExampleGroup.new(@what, parent).tap do |group|
|
||||
children = [] of ExampleGroup::Child
|
||||
@collection.each do |value|
|
||||
iter_locals = locals.merge({:TODO => value})
|
||||
iter_locals = locals.merge({@symbol => value})
|
||||
iter_children = @children.map do |child|
|
||||
child.build(group, iter_locals)
|
||||
end
|
||||
|
|
|
@ -59,7 +59,8 @@ module Spectator
|
|||
|
||||
::Spectator::DSL::Builder.start_given_group(
|
||||
{{collection.stringify}},
|
||||
%to_a
|
||||
%to_a,
|
||||
:%group
|
||||
)
|
||||
|
||||
{{block.body}}
|
||||
|
|
Loading…
Reference in a new issue