mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Deprecation warning now targets at 5.1
Also, added a test case to make sure that the default deprecation horizon is always bigger than the current Rails version.
This commit is contained in:
parent
bbd780f751
commit
6873db4699
2 changed files with 6 additions and 2 deletions
|
@ -32,7 +32,7 @@ module ActiveSupport
|
|||
# and the second is a library name
|
||||
#
|
||||
# ActiveSupport::Deprecation.new('2.0', 'MyLibrary')
|
||||
def initialize(deprecation_horizon = '5.0', gem_name = 'Rails')
|
||||
def initialize(deprecation_horizon = '5.1', gem_name = 'Rails')
|
||||
self.gem_name = gem_name
|
||||
self.deprecation_horizon = deprecation_horizon
|
||||
# By default, warnings are not silenced and debugging is off.
|
||||
|
|
|
@ -199,7 +199,7 @@ class DeprecationTest < ActiveSupport::TestCase
|
|||
end
|
||||
|
||||
def test_assert_deprecated_warn_work_with_default_behavior
|
||||
ActiveSupport::Deprecation.instance_variable_set('@behavior' , nil)
|
||||
ActiveSupport::Deprecation.instance_variable_set('@behavior', nil)
|
||||
assert_deprecated('abc') do
|
||||
ActiveSupport::Deprecation.warn 'abc'
|
||||
end
|
||||
|
@ -340,6 +340,10 @@ class DeprecationTest < ActiveSupport::TestCase
|
|||
assert_match(/You are calling deprecated method/, object.last_message)
|
||||
end
|
||||
|
||||
def test_default_deprecation_horizon_should_always_bigger_than_current_rails_version
|
||||
assert ActiveSupport::Deprecation.new.deprecation_horizon > ActiveSupport::VERSION::STRING
|
||||
end
|
||||
|
||||
def test_default_gem_name
|
||||
deprecator = ActiveSupport::Deprecation.new
|
||||
|
||||
|
|
Loading…
Reference in a new issue