mirror of
https://github.com/ruby/ruby.git
synced 2025-09-19 10:33:58 +02:00
merge revision(s) 35591: [Backport #7317]
test: why believe source directories are writable always? git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_3@37578 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
ba09c0a346
commit
427a95ecae
6 changed files with 30 additions and 27 deletions
|
@ -8,13 +8,16 @@
|
|||
# under the terms of Ruby's license.
|
||||
|
||||
require_relative "base"
|
||||
require "tempfile"
|
||||
|
||||
class TestCSV::Interface < TestCSV
|
||||
extend DifferentOFS
|
||||
|
||||
def setup
|
||||
super
|
||||
@path = File.join(File.dirname(__FILE__), "temp_test_data.csv")
|
||||
@tempfile = Tempfile.new(%w"temp .csv")
|
||||
@tempfile.close
|
||||
@path = @tempfile.path
|
||||
|
||||
File.open(@path, "wb") do |file|
|
||||
file << "1\t2\t3\r\n"
|
||||
|
@ -25,7 +28,7 @@ class TestCSV::Interface < TestCSV
|
|||
end
|
||||
|
||||
def teardown
|
||||
File.unlink(@path)
|
||||
@tempfile.close(true)
|
||||
super
|
||||
end
|
||||
|
||||
|
@ -112,7 +115,7 @@ 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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue