summaryrefslogtreecommitdiff
path: root/test/csv
diff options
context:
space:
mode:
authorjeg2 <jeg2@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-05-26 15:35:06 +0000
committerjeg2 <jeg2@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-05-26 15:35:06 +0000
commita9c056f1ed254c99152134235bd973ec503f64f2 (patch)
tree3896fb8bf7c10c2a03390fb8e45e828912fed8f5 /test/csv
parentb74f5dee4a3a2b62753e42b87ec26837d508fa9a (diff)
* lib/csv.rb: Enhance each() to support Enumerator.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31740 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/csv')
-rwxr-xr-xtest/csv/test_interface.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/test/csv/test_interface.rb b/test/csv/test_interface.rb
index 92da39c..785f431 100755
--- a/test/csv/test_interface.rb
+++ b/test/csv/test_interface.rb
@@ -112,6 +112,14 @@ class TestCSV::Interface < TestCSV
assert_equal(nil, csv.shift)
end
end
+
+ def test_enumerators_are_supported
+ CSV.open(@path, col_sep: "\t", row_sep: "\r\n") do |csv|
+ enum = csv.each
+ assert_instance_of(Enumerator, enum)
+ assert_equal(@expected.shift, enum.next)
+ end
+ end
### Test Write Interface ###