diff options
author | Eileen M. Uchitelle <eileencodes@users.noreply.github.com> | 2017-07-01 10:15:37 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-07-01 10:15:37 -0400 |
commit | 6189086c011a6ea6076c10d38da406e8f4065ac2 (patch) | |
tree | 9bcba61f54a18f8044644b1758d3d2127a374ce3 /railties/test | |
parent | 678e23d3b49c9e1920bca8a910b7914198944ccb (diff) | |
parent | 6fbd405a2eb585591bb57de5adae71f890a24af3 (diff) | |
download | rails-6189086c011a6ea6076c10d38da406e8f4065ac2.tar.gz rails-6189086c011a6ea6076c10d38da406e8f4065ac2.tar.bz2 rails-6189086c011a6ea6076c10d38da406e8f4065ac2.zip |
Merge pull request #29534 from y-yagi/clear_screenshots_in_tmp_clear_task
Clear screenshots files in `tmp:clear` task
Diffstat (limited to 'railties/test')
-rw-r--r-- | railties/test/application/rake/tmp_test.rb | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/railties/test/application/rake/tmp_test.rb b/railties/test/application/rake/tmp_test.rb new file mode 100644 index 0000000000..bc9865b0de --- /dev/null +++ b/railties/test/application/rake/tmp_test.rb @@ -0,0 +1,36 @@ +require "isolation/abstract_unit" + +module ApplicationTests + module RakeTests + class TmpTest < ActiveSupport::TestCase + include ActiveSupport::Testing::Isolation + + def setup + build_app + end + + def teardown + teardown_app + end + + test "tmp:clear clear cache, socket and screenshot files" do + Dir.chdir(app_path) do + FileUtils.mkdir_p("tmp/cache") + FileUtils.touch("tmp/cache/cache_file") + + FileUtils.mkdir_p("tmp/sockets") + FileUtils.touch("tmp/sockets/socket_file") + + FileUtils.mkdir_p("tmp/screenshots") + FileUtils.touch("tmp/screenshots/fail.png") + + `rails tmp:clear` + + assert_not File.exist?("tmp/cache/cache_file") + assert_not File.exist?("tmp/sockets/socket_file") + assert_not File.exist?("tmp/screenshots/fail.png") + end + end + end + end +end |