test.rb

Simple test case using nil as the non-row value. - Stephen Wattam, 12/07/2012 12:04 AM

Download (256 Bytes)

 
1
require 'csv'
2

    
3
# Create an empty row
4
row = CSV::Row.new( [], [] )
5

    
6
# Compare to nil
7
puts "NIL" if row == nil
8

    
9
# % ruby test.rb
10
# /usr/lib/ruby/1.9.1/csv.rb:478:in `==': undefined method `row' for nil:NilClass (NoMethodError)
11
#         from test.rb:7:in `<main>'
12