use a method that identifies an array also in 1.8.7

This commit is contained in:
Florian Hanke 2012-06-18 16:51:25 +10:00
parent 98ef21b4cc
commit 57fc08d3dd
1 changed files with 1 additions and 1 deletions

View File

@ -20,7 +20,7 @@ class CompileTest < Test::Unit::TestCase
params = keys.zip(match.captures).reduce({}) do |hash, mapping|
key, value = mapping
hash[key] = if existing = hash[key]
existing.respond_to?(:each) ? existing << value : [existing, value]
existing.respond_to?(:to_ary) ? existing << value : [existing, value]
else
value
end