summaryrefslogtreecommitdiff
path: root/test/csv
diff options
context:
space:
mode:
authorjeg2 <jeg2@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-04-01 14:35:03 +0000
committerjeg2 <jeg2@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-04-01 14:35:03 +0000
commit7c4d4e1eb2897cec295ea9316835fc3cfef96d6d (patch)
treeea5c883071e0e42591b68b01d380d13a165376f2 /test/csv
parent86034eafb2fb38ad28b181e39f4dd7514260fe0b (diff)
* lib/csv.rb: Don't attempt to convert nil headers.
Reported by Skye Shaw git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45497 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/csv')
-rwxr-xr-xtest/csv/test_headers.rb7
1 files changed, 7 insertions, 0 deletions
diff --git a/test/csv/test_headers.rb b/test/csv/test_headers.rb
index 069526f..94d5e9f 100755
--- a/test/csv/test_headers.rb
+++ b/test/csv/test_headers.rb
@@ -223,6 +223,13 @@ class TestCSV::Headers < TestCSV
assert_equal([:one, :two_three], csv.headers)
end
+ def test_builtin_converters_with_blank_header
+ csv = CSV.parse( "one,,three", headers: true,
+ return_headers: true,
+ header_converters: [:downcase, :symbol] )
+ assert_equal([:one, nil, :three], csv.headers)
+ end
+
def test_custom_converter
converter = lambda { |header| header.tr(" ", "_") }
csv = CSV.parse( "One,TWO Three",