From 5ddfc1fa4585bacf40d239ed1f5557197851a8b3 Mon Sep 17 00:00:00 2001 From: ser1zw Date: Tue, 4 Jan 2011 01:34:10 +0900 Subject: [PATCH] modified test helper to keep compatibility for Ruby 1.8 --- test/helper.rb | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/test/helper.rb b/test/helper.rb index 2f35133..71aa5c2 100755 --- a/test/helper.rb +++ b/test/helper.rb @@ -23,16 +23,16 @@ class OpenCVTestCase < Test::Unit::TestCase original_aref(*idx) end - def []=(*idx, val) - if idx.size == 1 - n = idx[0] + def []=(*args) + if args.size == 2 + n = args[0] # index throw ArgumentError.new("index #{n} is out of range") if n >= rows * cols else - j, i = *idx + j, i = *args throw ArgumentError.new("index for row #{j} is out of range") if j >= rows throw ArgumentError.new("index for column #{i} is out of range") if i >= cols end - original_aset(*idx, val) + original_aset(*args) end end