mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
[ruby/csv] Don't raise on eof?
GitHub: fix #86
Reported by krororo. Thanks!!!
5a8d9d9297
This commit is contained in:
parent
9171f83305
commit
8392592a0a
2 changed files with 14 additions and 0 deletions
|
|
@ -25,12 +25,15 @@ ggg,hhh,iii
|
|||
csv.shift)
|
||||
assert_equal(CSV::Row.new(headers, ["aaa", "bbb", "ccc"]),
|
||||
csv.shift)
|
||||
assert_equal(false, csv.eof?)
|
||||
error = assert_raise(CSV::MalformedCSVError) do
|
||||
csv.shift
|
||||
end
|
||||
assert_equal("Illegal quoting in line 3.",
|
||||
error.message)
|
||||
assert_equal(false, csv.eof?)
|
||||
assert_equal(CSV::Row.new(headers, ["ggg", "hhh", "iii"]),
|
||||
csv.shift)
|
||||
assert_equal(true, csv.eof?)
|
||||
end
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue