diff options
author | Edouard CHIN <edouard.chin@shopify.com> | 2018-10-01 18:00:18 -0400 |
---|---|---|
committer | Edouard CHIN <edouard.chin@shopify.com> | 2018-10-02 12:59:04 -0400 |
commit | 783f86822b49aa39d122f9c86939a17dac869cad (patch) | |
tree | 2278ea2002e443b53103a10c3baeea50eacab580 /activesupport/test | |
parent | cf608ee34dd833b0357ef4eefa692db33242d2aa (diff) | |
download | rails-783f86822b49aa39d122f9c86939a17dac869cad.tar.gz rails-783f86822b49aa39d122f9c86939a17dac869cad.tar.bz2 rails-783f86822b49aa39d122f9c86939a17dac869cad.zip |
Deprecate the `LoggerSilence` constant:
- I found this weird that the LoggerSilence wasn't using the
`ActiveSupport` namespace (AFAIK all other classes have it).
This PR deprecate the use of `LoggerSilence` for
`ActiveSupport::LoggerSilence` instead.
Diffstat (limited to 'activesupport/test')
-rw-r--r-- | activesupport/test/broadcast_logger_test.rb | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/activesupport/test/broadcast_logger_test.rb b/activesupport/test/broadcast_logger_test.rb index 181113e70a..ea2e388b8f 100644 --- a/activesupport/test/broadcast_logger_test.rb +++ b/activesupport/test/broadcast_logger_test.rb @@ -114,6 +114,14 @@ module ActiveSupport assert_equal [[::Logger::FATAL, "seen", nil]], log2.adds end + test "Including top constant LoggerSilence is deprecated" do + assert_deprecated("Please use `ActiveSupport::LoggerSilence`") do + logger = Class.new(CustomLogger) do + include ::LoggerSilence + end + end + end + class CustomLogger attr_reader :adds, :closed, :chevrons attr_accessor :level, :progname, :formatter, :local_level @@ -166,7 +174,7 @@ module ActiveSupport end class FakeLogger < CustomLogger - include LoggerSilence + include ActiveSupport::LoggerSilence end end end |