1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

[ruby/csv] Fix a bug that write_nil_value or write_empty_value don't work with non String

GitHub: fix GH-123

Reported by asm256. Thanks!!!

b4492139be
This commit is contained in:
Sutou Kouhei 2020-05-17 11:51:06 +09:00 committed by Nobuyoshi Nakada
parent 5359121a56
commit b8084b5cb4
No known key found for this signature in database
GPG key ID: 7CD2805BFA3770C6
Notes: git 2020-07-20 03:35:44 +09:00
2 changed files with 5 additions and 5 deletions

View file

@ -20,14 +20,14 @@ module TestCSVWriteConverters
end
def test_nil_value
assert_equal(%Q[a,NaN,c\n],
generate_line(["a", nil, "c"],
assert_equal(%Q[a,NaN,29\n],
generate_line(["a", nil, 29],
write_nil_value: "NaN"))
end
def test_empty_value
assert_equal(%Q[a,,c\n],
generate_line(["a", "", "c"],
assert_equal(%Q[a,,29\n],
generate_line(["a", "", 29],
write_empty_value: nil))
end
end