mirror of
https://gitea.invidious.io/iv-org/shard-spectator.git
synced 2024-08-15 00:53:35 +00:00
Fix values being wrapped twice
This simplifies some code.
This commit is contained in:
parent
cf0c438a5d
commit
dcbca302dc
2 changed files with 3 additions and 7 deletions
|
@ -2,9 +2,9 @@ require "./example_group_builder"
|
||||||
|
|
||||||
module Spectator
|
module Spectator
|
||||||
module DSL
|
module DSL
|
||||||
class GivenExampleGroupBuilder < ExampleGroupBuilder
|
class GivenExampleGroupBuilder(T) < ExampleGroupBuilder
|
||||||
|
|
||||||
def initialize(what : String, @collection : Array(Internals::ValueWrapper), @symbol : Symbol)
|
def initialize(what : String, @collection : Array(T), @symbol : Symbol)
|
||||||
super(what)
|
super(what)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -159,11 +159,7 @@ module Spectator
|
||||||
include {{@type.id}}
|
include {{@type.id}}
|
||||||
|
|
||||||
def {{to_a_method_name.id}}
|
def {{to_a_method_name.id}}
|
||||||
Array(::Spectator::Internals::ValueWrapper).new.tap do |array|
|
{{collection_method_name.id}}.to_a
|
||||||
{{collection_method_name.id}}.each do |item|
|
|
||||||
array << ::Spectator::Internals::TypedValueWrapper(typeof(item)).new(item)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue