summaryrefslogtreecommitdiff
path: root/test/csv/test_serialization.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/csv/test_serialization.rb')
-rwxr-xr-xtest/csv/test_serialization.rb6
1 files changed, 4 insertions, 2 deletions
diff --git a/test/csv/test_serialization.rb b/test/csv/test_serialization.rb
index ba19b7a3918..09440a426b1 100755
--- a/test/csv/test_serialization.rb
+++ b/test/csv/test_serialization.rb
@@ -131,7 +131,9 @@ class TestCSV::Serialization < TestCSV
def test_io
test_class_dump
- data_file = File.join(File.dirname(__FILE__), "serialization_test_data.csv")
+ tempfile = Tempfile.new(%w"serialization .csv")
+ tempfile.close
+ data_file = tempfile.path
CSV.dump(@names, File.open(data_file, "wb"))
assert(File.exist?(data_file))
@@ -145,7 +147,7 @@ class TestCSV::Serialization < TestCSV
assert_equal(@names, CSV.load(File.open(data_file)))
- File.unlink(data_file)
+ tempfile.close(true)
end
def test_custom_dump_and_load