diff options
Diffstat (limited to 'test')
-rwxr-xr-x | test/csv/test_features.rb | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/test/csv/test_features.rb b/test/csv/test_features.rb index 8c2b3eb2b7..9324af7096 100755 --- a/test/csv/test_features.rb +++ b/test/csv/test_features.rb @@ -299,12 +299,19 @@ class TestCSV::Features < TestCSV def test_comment_rows_are_ignored sample_data = "line,1,a\n#not,a,line\nline,2,b\n #also,no,line" c = CSV.new sample_data, :skip_lines => /\A\s*#/ - assert_equal c.each.to_a, [["line", "1", "a"], ["line", "2", "b"]] + assert_equal [["line", "1", "a"], ["line", "2", "b"]], c.each.to_a end def test_quoted_skip_line_markers_are_ignored sample_data = "line,1,a\n\"#not\",a,line\nline,2,b" c = CSV.new sample_data, :skip_lines => /\A\s*#/ - assert_equal c.each.to_a, [["line", "1", "a"], ["#not", "a", "line"], ["line", "2", "b"]] + assert_equal [["line", "1", "a"], ["#not", "a", "line"], ["line", "2", "b"]], c.each.to_a end + + def test_string_works_like_a_regexp + sample_data = "line,1,a\n#(not,a,line\nline,2,b\n also,#no,line" + c = CSV.new sample_data, :skip_lines => "#" + assert_equal [["line", "1", "a"], ["line", "2", "b"]], c.each.to_a + end + end |