Bug #10504 ยป csv_handle_file_descriptor_gracefully.diff
lib/csv.rb (working copy) | ||
---|---|---|
begin
|
||
yield csv
|
||
ensure
|
||
csv.close
|
||
csv.closed? || csv.close
|
||
end
|
||
else
|
||
csv
|
test/csv/test_interface.rb (working copy) | ||
---|---|---|
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
|