diff options
Diffstat (limited to 'railties/test/commands')
-rw-r--r-- | railties/test/commands/dev_cache_test.rb | 32 | ||||
-rw-r--r-- | railties/test/commands/server_test.rb | 17 |
2 files changed, 16 insertions, 33 deletions
diff --git a/railties/test/commands/dev_cache_test.rb b/railties/test/commands/dev_cache_test.rb deleted file mode 100644 index 1b7a72e7fc..0000000000 --- a/railties/test/commands/dev_cache_test.rb +++ /dev/null @@ -1,32 +0,0 @@ -require_relative '../isolation/abstract_unit' - -module CommandsTests - class DevCacheTest < 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 = `rails dev:cache` - assert File.exist?('tmp/caching-dev.txt') - assert_match(%r{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(%r{Development mode is no longer being cached}, output) - end - end - end -end diff --git a/railties/test/commands/server_test.rb b/railties/test/commands/server_test.rb index 0c49bd9c53..38a1605d1f 100644 --- a/railties/test/commands/server_test.rb +++ b/railties/test/commands/server_test.rb @@ -54,7 +54,8 @@ class Rails::ServerTest < ActiveSupport::TestCase def test_caching_without_option args = [] options = Rails::Server::Options.new.parse!(args) - assert_equal nil, options[:caching] + merged_options = Rails::Server.new.default_options.merge(options) + assert_equal nil, merged_options[:caching] end def test_caching_with_option @@ -117,4 +118,18 @@ class Rails::ServerTest < ActiveSupport::TestCase assert_equal old_default_options, server.default_options end end + + def test_restart_command_contains_customized_options + original_args = ARGV.dup + args = ["-p", "4567"] + ARGV.replace args + + options = Rails::Server::Options.new.parse! args + server = Rails::Server.new options + expected = "bin/rails server -p 4567" + + assert_equal expected, server.default_options[:restart_cmd] + ensure + ARGV.replace original_args + end end |