From ba2aea98079fb50a2c210001deb16ab84fac3b41 Mon Sep 17 00:00:00 2001 From: Scott Bronson Date: Sun, 7 Feb 2016 14:21:40 -0800 Subject: revert dev:cache to rake task, fixes #23410 --- railties/test/application/rake/dev_test.rb | 34 ++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 railties/test/application/rake/dev_test.rb (limited to 'railties/test/application') diff --git a/railties/test/application/rake/dev_test.rb b/railties/test/application/rake/dev_test.rb new file mode 100644 index 0000000000..43d7a5e156 --- /dev/null +++ b/railties/test/application/rake/dev_test.rb @@ -0,0 +1,34 @@ +require 'isolation/abstract_unit' + +module ApplicationTests + module RakeTests + class RakeDevTest < ActiveSupport::TestCase + include ActiveSupport::Testing::Isolation + + def setup + build_app + end + + def teardown + teardown_app + end + + test 'dev:cache creates file and outputs message' do + Dir.chdir(app_path) do + output = `rake dev:cache` + assert File.exist?('tmp/caching-dev.txt') + assert_match(/Development mode is now being cached/, output) + end + end + + test 'dev:cache deletes file and outputs message' do + Dir.chdir(app_path) do + `rails dev:cache` # Create caching file. + output = `rails dev:cache` # Delete caching file. + assert_not File.exist?('tmp/caching-dev.txt') + assert_match(/Development mode is no longer being cached/, output) + end + end + end + end +end -- cgit v1.2.3