summaryrefslogtreecommitdiff
path: root/test/csv/test_features.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/csv/test_features.rb')
-rwxr-xr-xtest/csv/test_features.rb9
1 files changed, 9 insertions, 0 deletions
diff --git a/test/csv/test_features.rb b/test/csv/test_features.rb
index a1f1ddbd15..3f9359faaf 100755
--- a/test/csv/test_features.rb
+++ b/test/csv/test_features.rb
@@ -353,6 +353,15 @@ class TestCSV::Features < TestCSV
assert_equal [["line", "1", "a"], ["line", "2", "b"]], c.each.to_a
end
+ def test_comment_rows_are_ignored_with_heredoc
+ c = csv = CSV.new(<<~EOL, skip_lines: ".")
+ 1,foo
+ .2,bar
+ 3,baz
+ EOL
+ assert_equal [["1", "foo"], ["3", "baz"]], 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*#/