diff options
author | Chuck Callebs <chuck@callebs.io> | 2015-07-20 23:35:20 -0400 |
---|---|---|
committer | Chuck Callebs <chuck@callebs.io> | 2015-08-04 23:41:23 -0400 |
commit | a01e58afd9ef301db17e952a9a42a4ec96cc5661 (patch) | |
tree | e037062e270bf5c88a778b536818b9d568718f1d /railties/test/application/rake | |
parent | 10e994cc07dbd4ff87db225f15850197a9c6bb18 (diff) | |
download | rails-a01e58afd9ef301db17e952a9a42a4ec96cc5661.tar.gz rails-a01e58afd9ef301db17e952a9a42a4ec96cc5661.tar.bz2 rails-a01e58afd9ef301db17e952a9a42a4ec96cc5661.zip |
Add rake dev:cache task to enable dev mode caching.
Taken from @Sonopa's commits on PR #19091.
Add support for dev caching via "rails s" flags.
Implement suggestions from @kaspth.
Remove temporary cache file if server does not have flags.
Break at 80 characters in railties/CHANGELOG.md
Remove ability to disable cache based on server options.
Add more comprehensive options: --dev-caching / --no-dev-caching
Diffstat (limited to 'railties/test/application/rake')
-rw-r--r-- | railties/test/application/rake/dev_test.rb | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/railties/test/application/rake/dev_test.rb b/railties/test/application/rake/dev_test.rb new file mode 100644 index 0000000000..28d8b22a37 --- /dev/null +++ b/railties/test/application/rake/dev_test.rb @@ -0,0 +1,35 @@ +require 'isolation/abstract_unit' + +module ApplicationTests + module RakeTests + class RakeDevTest < ActiveSupport::TestCase + include ActiveSupport::Testing::Isolation + + def setup + build_app + boot_rails + 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 + output = `rake dev:cache` + output = `rake dev:cache` + assert_not File.exist?('tmp/caching-dev.txt') + assert_match(/Development mode is no longer being cached/, output) + end + end + end + end +end |