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/commands | |
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/commands')
-rw-r--r-- | railties/test/commands/server_test.rb | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/railties/test/commands/server_test.rb b/railties/test/commands/server_test.rb index ba688f1e9e..7a063aeddf 100644 --- a/railties/test/commands/server_test.rb +++ b/railties/test/commands/server_test.rb @@ -44,6 +44,22 @@ class Rails::ServerTest < ActiveSupport::TestCase end end + def test_caching_without_option + args = [] + options = Rails::Server::Options.new.parse!(args) + assert_equal nil, options[:caching] + end + + def test_caching_with_option + args = ["--dev-caching"] + options = Rails::Server::Options.new.parse!(args) + assert_equal true, options[:caching] + + args = ["--no-dev-caching"] + options = Rails::Server::Options.new.parse!(args) + assert_equal false, options[:caching] + end + def test_log_stdout with_rack_env nil do with_rails_env nil do |