diff options
Diffstat (limited to 'test/csv')
-rwxr-xr-x | test/csv/test_features.rb | 9 | ||||
-rwxr-xr-x | test/csv/test_interface.rb | 3 |
2 files changed, 12 insertions, 0 deletions
diff --git a/test/csv/test_features.rb b/test/csv/test_features.rb index f8aa0d87c5..a1f1ddbd15 100755 --- a/test/csv/test_features.rb +++ b/test/csv/test_features.rb @@ -137,6 +137,15 @@ class TestCSV::Features < TestCSV test_lineno end + def test_unknown_options + assert_raise_with_message(ArgumentError, /unknown keyword/) { + CSV.new(@sample_data, unknown: :error) + } + assert_raise_with_message(ArgumentError, /unknown keyword/) { + CSV.new(@sample_data, universal_newline: true) + } + end + def test_skip_blanks assert_equal(4, @csv.to_a.size) diff --git a/test/csv/test_interface.rb b/test/csv/test_interface.rb index a12545c8b0..0ae03b0184 100755 --- a/test/csv/test_interface.rb +++ b/test/csv/test_interface.rb @@ -166,6 +166,9 @@ class TestCSV::Interface < TestCSV assert_not_nil(line) assert_instance_of(String, line) assert_equal("1;2;3\n", line) + + line = CSV.generate_line(%w"1 2", row_sep: nil) + assert_equal("1,2", line) end def test_write_header_detection |