Layouts use strings as keys, so that must be realistic
This commit is contained in:
@@ -65,7 +65,7 @@ module Squib
|
|||||||
val = instance_variable_get(attribute)
|
val = instance_variable_get(attribute)
|
||||||
if val.respond_to? :each
|
if val.respond_to? :each
|
||||||
new_val = val.map.with_index do |v, i|
|
new_val = val.map.with_index do |v, i|
|
||||||
v ||= layout[layout_args[i].to_s][param] unless layout_args[i].nil?
|
v ||= layout[layout_args[i].to_s][param.to_s] unless layout_args[i].nil?
|
||||||
v ||= default
|
v ||= default
|
||||||
end
|
end
|
||||||
instance_variable_set(attribute, new_val)
|
instance_variable_set(attribute, new_val)
|
||||||
|
|||||||
@@ -49,8 +49,8 @@ describe Squib::Args::Box do
|
|||||||
|
|
||||||
context 'layouts' do
|
context 'layouts' do
|
||||||
let(:layout) do
|
let(:layout) do
|
||||||
{ 'attack' => { x: 50 },
|
{ 'attack' => { 'x' => 50 },
|
||||||
'defend' => { x: 60 } }
|
'defend' => { 'x' => 60 } }
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'are used when not specified' do
|
it 'are used when not specified' do
|
||||||
|
|||||||
Reference in New Issue
Block a user