Fix values being wrapped twice

This simplifies some code.
This commit is contained in:
Michael Miller 2018-09-23 17:13:30 -06:00
parent cf0c438a5d
commit dcbca302dc
2 changed files with 3 additions and 7 deletions

View file

@ -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

View file

@ -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