summaryrefslogtreecommitdiff
path: root/test/csv/test_csv.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/csv/test_csv.rb')
-rw-r--r--test/csv/test_csv.rb16
1 files changed, 16 insertions, 0 deletions
diff --git a/test/csv/test_csv.rb b/test/csv/test_csv.rb
index 41e25fe5ec4..6e95a1ba852 100644
--- a/test/csv/test_csv.rb
+++ b/test/csv/test_csv.rb
@@ -1207,12 +1207,28 @@ public
assert_equal([["Avenches", "aus Umgebung"], ["Bad Hersfeld", "Ausgrabung"]], rows)
rows = []
+ assert_raises(CSV::IllegalFormatError) do
+ CSV.open(@macfile, "r") do |row|
+ rows << row.to_a
+ end
+ end
+
+ rows = []
file = File.open(@macfile)
CSV::Reader.parse(file.read, ?,, ?\r) do |row|
rows << row.to_a
end
assert_equal([["Avenches", "aus Umgebung"], ["Bad Hersfeld", "Ausgrabung"]], rows)
file.close
+
+ rows = []
+ file = File.open(@macfile)
+ assert_raises(CSV::IllegalFormatError) do
+ CSV::Reader.parse(file.read, ?,) do |row|
+ rows << row.to_a
+ end
+ end
+ file.close
end