diff options
author | jeg2 <jeg2@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-04-01 14:35:03 +0000 |
---|---|---|
committer | jeg2 <jeg2@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-04-01 14:35:03 +0000 |
commit | 7c4d4e1eb2897cec295ea9316835fc3cfef96d6d (patch) | |
tree | ea5c883071e0e42591b68b01d380d13a165376f2 /test | |
parent | 86034eafb2fb38ad28b181e39f4dd7514260fe0b (diff) | |
download | ruby-7c4d4e1eb2897cec295ea9316835fc3cfef96d6d.tar.gz |
* 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')
-rwxr-xr-x | test/csv/test_headers.rb | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/test/csv/test_headers.rb b/test/csv/test_headers.rb index 069526fc03..94d5e9f03e 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", |