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:
parent
5359121a56
commit
b8084b5cb4
Notes:
git
2020-07-20 03:35:44 +09:00
2 changed files with 5 additions and 5 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue