summaryrefslogtreecommitdiff
path: root/test/csv
diff options
context:
space:
mode:
authorhsbt <hsbt@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-08-22 06:40:59 +0000
committerhsbt <hsbt@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-08-22 06:40:59 +0000
commitede0df3a9b38d18f46aecf70075dda688c9bd4c1 (patch)
treea7f8ee274d16bf1d870650005950a240f5f04c10 /test/csv
parent20aed4495bfa0a1f7844501c9118bd2369fe460b (diff)
Gracefully handle CSV IO when file descriptor closed.
[Bug #10504][ruby-core:66240] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59642 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 f2c774f..be27fcd 100755
--- a/test/csv/test_interface.rb
+++ b/test/csv/test_interface.rb
@@ -137,6 +137,14 @@ class TestCSV::Interface < TestCSV
end
end
+ def test_open_handles_prematurely_closed_file_descriptor_gracefully
+ assert_nothing_raised(Exception) do
+ CSV.open(@path) do |csv|
+ csv.close
+ end
+ end
+ end
+
### Test Write Interface ###
def test_generate