# File test/test_to_a.rb, line 8 def setup @parser = Class.new(CSVobj) end
# File test/test_to_a.rb, line 12 def teardown @parser = nil end
# File test/test_to_a.rb, line 16 def test_one_complete_object s = "foo,bar,baz\n1,2,3\n" objs = @parser.parse(s) assert_equal(1, objs.size) assert_equal(%w[ 1 2 3 ], objs[0].to_a) end
# File test/test_to_a.rb, line 23 def test_one_object_missing_data_cell s = "foo,bar,baz\n1,2\n" objs = @parser.parse(s) assert_equal(1, objs.size) assert_equal([ '1', '2', nil ], objs[0].to_a) end
# File test/test_to_a.rb, line 30 def test_one_object_missing_header s = "foo,bar\n1,2,3\n" objs = @parser.parse(s) assert_equal(1, objs.size) assert_equal(%w[ 1 2 ], objs[0].to_a) end