Layouts use strings as keys, so that must be realistic

dev
Andy Meneely 2015-06-11 17:20:02 -04:00
parent 78ee185fde
commit b5903293d7
2 changed files with 3 additions and 3 deletions

View File

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

View File

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