diff options
author | hsbt <hsbt@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-08-22 06:57:00 +0000 |
---|---|---|
committer | hsbt <hsbt@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-08-22 06:57:00 +0000 |
commit | ffb49a7e9b8ed9cc130508ff4306dd1c0a38e6c8 (patch) | |
tree | 3d57e6a3e9350acf615437cf25d719bbf41909cd /test | |
parent | ede0df3a9b38d18f46aecf70075dda688c9bd4c1 (diff) |
Fixed regression to convert blank value at r45497.
[Bug #11126][ruby-core:69088]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59643 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rwxr-xr-x | test/csv/test_data_converters.rb | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/test/csv/test_data_converters.rb b/test/csv/test_data_converters.rb index e274b2b10b..0786ca6d0f 100755 --- a/test/csv/test_data_converters.rb +++ b/test/csv/test_data_converters.rb @@ -176,6 +176,15 @@ class TestCSV::DataConverters < TestCSV @parser.shift.fields ) end + def test_custom_converter_with_blank_field + converter = lambda { |field| field.nil? } + row = nil + assert_nothing_raised(Exception) do + row = CSV.parse_line('nil,', converters: converter) + end + assert_equal([false, true], row); + end + def test_shortcut_interface assert_equal( ["Numbers", ":integer", 1, ":float", 3.015], CSV.parse_line(@data, converters: :numeric) ) |