summaryrefslogtreecommitdiff
path: root/spec/support
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2014-07-31 21:01:42 +0300
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2014-07-31 21:01:42 +0300
commita35a22ae051d9b1ab97eb91ea4354baba2addf80 (patch)
tree774c11007bf0e65b136c9efcf28d42119fdc3cfe /spec/support
parentcbe4891d7c44d59c902d13315eb3140fb6d47486 (diff)
downloadgitlab-ce-a35a22ae051d9b1ab97eb91ea4354baba2addf80.tar.gz
Remove test dir only if exists
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
Diffstat (limited to 'spec/support')
-rw-r--r--spec/support/test_env.rb8
1 files changed, 6 insertions, 2 deletions
diff --git a/spec/support/test_env.rb b/spec/support/test_env.rb
index 9e8339ff71a..1f930eac026 100644
--- a/spec/support/test_env.rb
+++ b/spec/support/test_env.rb
@@ -15,8 +15,12 @@ module TestEnv
# Clean /tmp/tests
tmp_test_path = Rails.root.join('tmp', 'tests')
- FileUtils.rm_r(tmp_test_path)
- FileUtils.mkdir(tmp_test_path)
+
+ if File.directory?(tmp_test_path)
+ FileUtils.rm_r(tmp_test_path)
+ end
+
+ FileUtils.mkdir_p(tmp_test_path)
# Setup GitLab shell for test instance
setup_gitlab_shell