summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authormarcandre <marcandre@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-07-21 21:40:21 +0000
committermarcandre <marcandre@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-07-21 21:40:21 +0000
commit01e1dcef9a275797d1497fcf91c2873b91573469 (patch)
tree91f88b946ee738032bf7a9d66c0bd06a5d03f374 /test
parent1d9cac36ea4d84a6e3242c7b8a30d05b6df64145 (diff)
* backport of r32600 from trunk
* lib/csv.rb: Do not modify CSV.generate's argument [ruby-core:38356] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_3@32602 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rwxr-xr-xtest/csv/test_interface.rb15
1 files changed, 15 insertions, 0 deletions
diff --git a/test/csv/test_interface.rb b/test/csv/test_interface.rb
index 785f43126b..9cdbcec451 100755
--- a/test/csv/test_interface.rb
+++ b/test/csv/test_interface.rb
@@ -316,4 +316,19 @@ class TestCSV::Interface < TestCSV
assert_equal(STDOUT, CSV.instance.instance_eval { @io })
assert_equal(STDOUT, CSV { |new_csv| new_csv.instance_eval { @io } })
end
+
+ def test_options_are_not_modified
+ opt = {}.freeze
+ assert_nothing_raised { CSV.foreach(@path, opt) }
+ assert_nothing_raised { CSV.open(@path, opt){} }
+ assert_nothing_raised { CSV.parse("", opt) }
+ assert_nothing_raised { CSV.parse_line("", opt) }
+ assert_nothing_raised { CSV.read(@path, opt) }
+ assert_nothing_raised { CSV.readlines(@path, opt) }
+ assert_nothing_raised { CSV.table(@path, opt) }
+ assert_nothing_raised { CSV.generate(opt){} }
+ assert_nothing_raised { CSV.generate_line([], opt) }
+ assert_nothing_raised { CSV.filter("", "", opt){} }
+ assert_nothing_raised { CSV.instance("", opt) }
+ end
end