Project

General

Profile

Actions

Bug #7528

closed

CSV.== fails to check object type

Added by SteveW (Stephen Wattam) over 11 years ago. Updated over 11 years ago.

Status:
Closed
Target version:
ruby -v:
ruby 1.9.3p327 (2012-11-10 revision 37606) [x86_64-linux]
Backport:
[ruby-core:50636]

Description

CSV::Row's equality method presumes it is comparing another CSV::Row. It fails when the object to be compared doesn't support the 'row' method:

/usr/lib/ruby/1.9.1/csv.rb:478:in ==': undefined method row' for nil:NilClass (NoMethodError)
from test.rb:7:in `'


Files

test.rb (256 Bytes) test.rb Simple test case using nil as the non-row value. SteveW (Stephen Wattam), 12/07/2012 12:04 AM
csv.rb.patch (121 Bytes) csv.rb.patch SteveW (Stephen Wattam), 12/07/2012 10:42 PM
Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0Like0