aboutsummaryrefslogtreecommitdiffstats
path: root/test/csv
diff options
context:
space:
mode:
authorzzak <zzak@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-05-25 16:41:40 +0000
committerzzak <zzak@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-05-25 16:41:40 +0000
commit0aa197c6f2740ba9ed5e543737965164a356781e (patch)
treeccdaf199f893ed8b66ca2f0c400c954aa09a8448 /test/csv
parentc8660d896698e31a62ad9c149213e315a70a1035 (diff)
downloadruby-0aa197c6f2740ba9ed5e543737965164a356781e.tar.gz
* lib/csv.rb: Reject nil as data source for CSV.new, patch by @Peeja.
[Fixes GH-580] https://github.com/ruby/ruby/pull/580 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46123 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/csv')
-rwxr-xr-xtest/csv/test_interface.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/test/csv/test_interface.rb b/test/csv/test_interface.rb
index 89b4a462f9..d6bf470f6b 100755
--- a/test/csv/test_interface.rb
+++ b/test/csv/test_interface.rb
@@ -130,6 +130,12 @@ class TestCSV::Interface < TestCSV
end
end
+ def test_nil_is_not_acceptable
+ assert_raise_with_message ArgumentError, "Cannot parse nil as CSV" do
+ CSV.new(nil)
+ end
+ end
+
### Test Write Interface ###
def test_generate