Permalink
Browse files

Fix activesupport atomic_write tests when Dir.tmpdir is on another pa…

…rtition. Closes #8573 [tpope]

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7412 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
  • Loading branch information...
1 parent a75d273 commit 8a9f43ecbb99f470cc8720c09a1c9480abdc845e @NZKoz NZKoz committed Sep 6, 2007
Showing with 2 additions and 2 deletions.
  1. +2 −2 activesupport/test/core_ext/file_test.rb
@@ -4,14 +4,14 @@ class AtomicWriteTest < Test::Unit::TestCase
def test_atomic_write_without_errors
contents = "Atomic Text"
- File.atomic_write(file_name) do |file|
+ File.atomic_write(file_name, Dir.pwd) do |file|
file.write(contents)
assert !File.exists?(file_name)
end
assert File.exists?(file_name)
assert_equal contents, File.read(file_name)
ensure
- File.unlink(file_name)
+ File.unlink(file_name) rescue nil
end
def test_atomic_write_doesnt_write_when_block_raises

0 comments on commit 8a9f43e

Please sign in to comment.