summaryrefslogtreecommitdiff
path: root/test/csv
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-12-25 06:04:07 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-12-25 06:04:07 +0000
commit9b0f2e48d7cc0cd9ee235eda33a040e40bd4a62b (patch)
treee5ccca89d13629051b89cd9bdb81fbc3f8261d34 /test/csv
parent402402741dccdda8d52e548cc9dc89b806d852f9 (diff)
* test/csv/test_encodings.rb (TestEncodings#setup): fix evil test
suite writing to the source directory. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30351 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/csv')
-rw-r--r--test/csv/test_encodings.rb7
1 files changed, 5 insertions, 2 deletions
diff --git a/test/csv/test_encodings.rb b/test/csv/test_encodings.rb
index 8470286..82dca91 100644
--- a/test/csv/test_encodings.rb
+++ b/test/csv/test_encodings.rb
@@ -13,11 +13,14 @@ require "csv"
class TestEncodings < Test::Unit::TestCase
def setup
- @temp_csv_path = File.join(File.dirname(__FILE__), "temp.csv")
+ require 'tempfile'
+ @temp_csv_file = Tempfile.new(%w"test_csv. .csv")
+ @temp_csv_path = @temp_csv_file.path
+ @temp_csv_file.close
end
def teardown
- File.unlink(@temp_csv_path) if File.exist? @temp_csv_path
+ @temp_csv_file.close!
end
########################################