summaryrefslogtreecommitdiff
path: root/spec/support
diff options
context:
space:
mode:
authorYorick Peterse <yorickpeterse@gmail.com>2015-10-02 16:25:47 +0200
committerYorick Peterse <yorickpeterse@gmail.com>2015-10-02 16:25:47 +0200
commitdbc05d4a62468a8b7ebbeb17da4f74edaa09f968 (patch)
treecae823956d3691d5433384dc1ed0c5f6964ee948 /spec/support
parentc867c225095319684ad6ff396e4194bb1b5920d5 (diff)
downloadgitlab-ce-dbc05d4a62468a8b7ebbeb17da4f74edaa09f968.tar.gz
Don't use "rm" for cleaning tmp/builds
If this directory were to be empty this would result in warnings being printed to STDERR, cluttering spec output. Doing this in Ruby fixes this problem (and also removes the need for shell alltogether).
Diffstat (limited to 'spec/support')
-rw-r--r--spec/support/setup_builds_storage.rb6
1 files changed, 4 insertions, 2 deletions
diff --git a/spec/support/setup_builds_storage.rb b/spec/support/setup_builds_storage.rb
index a3e59646187..a4f21e95338 100644
--- a/spec/support/setup_builds_storage.rb
+++ b/spec/support/setup_builds_storage.rb
@@ -10,8 +10,10 @@ RSpec.configure do |config|
end
config.after(:suite) do
- Dir.chdir(builds_path) do
- `ls | grep -v .gitkeep | xargs rm -r`
+ Dir[File.join(builds_path, '*')].each do |path|
+ next if File.basename(path) == '.gitkeep'
+
+ FileUtils.rm_rf(path)
end
end
end