summaryrefslogtreecommitdiff
path: root/test/csv
diff options
context:
space:
mode:
Diffstat (limited to 'test/csv')
-rwxr-xr-xtest/csv/test_data_converters.rb9
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) )