aboutsummaryrefslogtreecommitdiffstats
path: root/railties/lib
diff options
context:
space:
mode:
authoryuuji.yaginuma <yuuji.yaginuma@gmail.com>2017-06-22 22:17:18 +0900
committeryuuji.yaginuma <yuuji.yaginuma@gmail.com>2017-06-27 07:13:00 +0900
commit6fbd405a2eb585591bb57de5adae71f890a24af3 (patch)
tree42c7da14d4ab21bd7659f254e0fee47bd18aae53 /railties/lib
parent61cc630ac7e7f8554dc049a3e5a2509c00303ef8 (diff)
downloadrails-6fbd405a2eb585591bb57de5adae71f890a24af3.tar.gz
rails-6fbd405a2eb585591bb57de5adae71f890a24af3.tar.bz2
rails-6fbd405a2eb585591bb57de5adae71f890a24af3.zip
Clear screenshots files in `tmp:clear` task
If system test fails, it creates screenshot under `tmp/screenshots`. https://github.com/rails/rails/blob/34fe2a4fc778d18b7fe6bdf3629c1481bee789b9/actionpack/lib/action_dispatch/system_testing/test_helpers/screenshot_helper.rb#L45 But currently, screenshot files is not cleared by `tmp:clear` task. This patch make clears screenshot files with `tmp:clear` task as well as other tmp files.
Diffstat (limited to 'railties/lib')
-rw-r--r--railties/lib/rails/tasks/tmp.rake11
1 files changed, 9 insertions, 2 deletions
diff --git a/railties/lib/rails/tasks/tmp.rake b/railties/lib/rails/tasks/tmp.rake
index d42a890cb6..3d8ced1bf3 100644
--- a/railties/lib/rails/tasks/tmp.rake
+++ b/railties/lib/rails/tasks/tmp.rake
@@ -1,6 +1,6 @@
namespace :tmp do
- desc "Clear cache and socket files from tmp/ (narrow w/ tmp:cache:clear, tmp:sockets:clear)"
- task clear: ["tmp:cache:clear", "tmp:sockets:clear"]
+ desc "Clear cache, socket and screenshot files from tmp/ (narrow w/ tmp:cache:clear, tmp:sockets:clear, tmp:screenshots:clear)"
+ task clear: ["tmp:cache:clear", "tmp:sockets:clear", "tmp:screenshots:clear"]
tmp_dirs = [ "tmp/cache",
"tmp/sockets",
@@ -32,4 +32,11 @@ namespace :tmp do
rm Dir["tmp/pids/[^.]*"], verbose: false
end
end
+
+ namespace :screenshots do
+ # desc "Clears all files in tmp/screenshots"
+ task :clear do
+ rm Dir["tmp/screenshots/[^.]*"], verbose: false
+ end
+ end
end