aboutsummaryrefslogtreecommitdiffstats
path: root/railties/test
diff options
context:
space:
mode:
authoryuuji.yaginuma <yuuji.yaginuma@gmail.com>2018-09-01 16:31:15 +0900
committerYuji Yaginuma <yuuji.yaginuma@gmail.com>2018-09-04 20:06:54 +0900
commitfb3642b0caf42b0554a8fd0672943f4da1643b2c (patch)
treef82e8de176f593602a44d45fbbf4d85d5ad325c0 /railties/test
parent63c6943131189c902485f725b465b48ebea14b09 (diff)
downloadrails-fb3642b0caf42b0554a8fd0672943f4da1643b2c.tar.gz
rails-fb3642b0caf42b0554a8fd0672943f4da1643b2c.tar.bz2
rails-fb3642b0caf42b0554a8fd0672943f4da1643b2c.zip
Respect config setting when output deprecation notice in rake tasks
The rake tasks which became deprecate now does not load the environment. Therefore, even if the application specifies the behavior of deprecating, the message is output to stderr ignoring the specification. It seems that this is not the expected behavior. We should respect the setting even in the rake tasks.
Diffstat (limited to 'railties/test')
-rw-r--r--railties/test/application/rake/dev_test.rb1
-rw-r--r--railties/test/application/rake/initializers_test.rb2
-rw-r--r--railties/test/application/rake/notes_test.rb1
-rw-r--r--railties/test/application/rake/routes_test.rb1
4 files changed, 4 insertions, 1 deletions
diff --git a/railties/test/application/rake/dev_test.rb b/railties/test/application/rake/dev_test.rb
index e408760ecc..a87f453075 100644
--- a/railties/test/application/rake/dev_test.rb
+++ b/railties/test/application/rake/dev_test.rb
@@ -9,6 +9,7 @@ module ApplicationTests
def setup
build_app
+ add_to_env_config("development", "config.active_support.deprecation = :stderr")
end
def teardown
diff --git a/railties/test/application/rake/initializers_test.rb b/railties/test/application/rake/initializers_test.rb
index fb498e28ad..8de4967021 100644
--- a/railties/test/application/rake/initializers_test.rb
+++ b/railties/test/application/rake/initializers_test.rb
@@ -29,6 +29,8 @@ module ApplicationTests
end
test "`rake initializers` outputs a deprecation warning" do
+ add_to_env_config("development", "config.active_support.deprecation = :stderr")
+
stderr = capture(:stderr) { run_rake_initializers }
assert_match(/DEPRECATION WARNING: Using `bin\/rake initializers` is deprecated and will be removed in Rails 6.1/, stderr)
end
diff --git a/railties/test/application/rake/notes_test.rb b/railties/test/application/rake/notes_test.rb
index 9e22ba84b5..60802ef7c4 100644
--- a/railties/test/application/rake/notes_test.rb
+++ b/railties/test/application/rake/notes_test.rb
@@ -10,6 +10,7 @@ module ApplicationTests
def setup
build_app
+ add_to_env_config("development", "config.active_support.deprecation = :stderr")
require "rails/all"
super
end
diff --git a/railties/test/application/rake/routes_test.rb b/railties/test/application/rake/routes_test.rb
index e49ce50b69..2c23ff4679 100644
--- a/railties/test/application/rake/routes_test.rb
+++ b/railties/test/application/rake/routes_test.rb
@@ -28,7 +28,6 @@ update_rails_disk_service PUT /rails/active_storage/disk/:encoded_token(.:forma
end
test "`rake routes` outputs a deprecation warning" do
- remove_from_env_config("development", ".*config\.active_support\.deprecation.*\n")
add_to_env_config("development", "config.active_support.deprecation = :stderr")
stderr = capture(:stderr) { run_rake_routes }