Skip to content

Commit 77cc660

Browse files
committed
Avoid FileUtils
I'm getting sporadic failures on Travis CI due to this part of the code. What *seems* to be happening is that the FileUtils.rm_rf call is either not properly removing everything, or it's returning before everything has actually been deleting. This means that when we run the cp_r, path already exists, so instead of application.root being copied *as* path, it's copied *into* path. Shelling out should hopefully be more reliable.
1 parent b07f20b commit 77cc660

File tree

1 file changed

+3
-11
lines changed

1 file changed

+3
-11
lines changed

test/acceptance/helper.rb

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -57,16 +57,8 @@ def stderr
5757
@stderr ||= IO.pipe
5858
end
5959

60-
def log_file_path
61-
path("tmp/spring.log")
62-
end
63-
6460
def log_file
65-
@log_file ||= begin
66-
tmp = path("tmp")
67-
tmp.mkdir unless tmp.exist?
68-
tmp.join("spring.log").open("w+")
69-
end
61+
@log_file ||= path("tmp/spring.log").open("w+")
7062
end
7163

7264
def env
@@ -329,8 +321,8 @@ def install_spring
329321
end
330322

331323
def copy_to(path)
332-
FileUtils.rm_rf(path.to_s)
333-
FileUtils.cp_r(application.root.to_s, path.to_s)
324+
system("rm -rf #{path}")
325+
system("cp -r #{application.root} #{path}")
334326
end
335327
end
336328
end

0 commit comments

Comments
 (0)