diff options
author | jeg2 <jeg2@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-12-07 17:42:16 +0000 |
---|---|---|
committer | jeg2 <jeg2@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-12-07 17:42:16 +0000 |
commit | 5b1065f3fee2a3cb0095a28a5bedaa3f74f09a5b (patch) | |
tree | 85bc2c434a39ae32cbe2eb475bb6835a168bca58 /test/csv | |
parent | 0dc6b83935ce6b35d8443f51b787ac2300197c12 (diff) |
* 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
Diffstat (limited to 'test/csv')
-rwxr-xr-x | test/csv/test_row.rb | 6 |
1 files changed, 5 insertions, 1 deletions
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 |