From 5b1065f3fee2a3cb0095a28a5bedaa3f74f09a5b Mon Sep 17 00:00:00 2001 From: jeg2 Date: Fri, 7 Dec 2012 17:42:16 +0000 Subject: * lib/csv.rb: A fix for row comparison by Stephen Wattam. [Bug #7528] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38265 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/csv/test_row.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'test/csv/test_row.rb') diff --git a/test/csv/test_row.rb b/test/csv/test_row.rb index 345b7a2342..3016c5b57c 100755 --- a/test/csv/test_row.rb +++ b/test/csv/test_row.rb @@ -256,7 +256,7 @@ class TestCSV::Row < TestCSV assert_equal( [["A", 1], ["A", 4], ["A", nil]], @row.select { |pair| pair.first == "A" } ) - assert_equal(10, @row.inject(0) { |sum, (header, n)| sum + (n || 0) }) + assert_equal(10, @row.inject(0) { |sum, (_, n)| sum + (n || 0) }) end def test_to_a @@ -310,4 +310,8 @@ class TestCSV::Row < TestCSV "Header field pair not found." ) end end + + def test_can_be_compared_with_other_classes + assert(CSV::Row.new([ ], [ ]) != nil, "The row was nil") + end end -- cgit v1.2.3