From b5903293d7d4ee654132613ebc49f62f548b8a37 Mon Sep 17 00:00:00 2001 From: Andy Meneely Date: Thu, 11 Jun 2015 17:20:02 -0400 Subject: [PATCH] Layouts use strings as keys, so that must be realistic --- lib/squib/args/arg_loader.rb | 2 +- spec/args/box_spec.rb | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/squib/args/arg_loader.rb b/lib/squib/args/arg_loader.rb index cf9dfc5..8856158 100644 --- a/lib/squib/args/arg_loader.rb +++ b/lib/squib/args/arg_loader.rb @@ -65,7 +65,7 @@ module Squib val = instance_variable_get(attribute) if val.respond_to? :each 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 end instance_variable_set(attribute, new_val) diff --git a/spec/args/box_spec.rb b/spec/args/box_spec.rb index 2d635b7..a30b478 100644 --- a/spec/args/box_spec.rb +++ b/spec/args/box_spec.rb @@ -49,8 +49,8 @@ describe Squib::Args::Box do context 'layouts' do let(:layout) do - { 'attack' => { x: 50 }, - 'defend' => { x: 60 } } + { 'attack' => { 'x' => 50 }, + 'defend' => { 'x' => 60 } } end it 'are used when not specified' do