aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport
diff options
context:
space:
mode:
authorAkira Matsuda <ronnie@dio.jp>2015-12-19 16:35:38 +0900
committerAkira Matsuda <ronnie@dio.jp>2015-12-19 16:41:07 +0900
commit6873db4699ac727dd27eedb0994ecdd976b40901 (patch)
treecc0f6046becbf12935ea312039fa7a77ae6c3907 /activesupport
parentbbd780f75147b8560596f0a64b98d82f44b621ad (diff)
downloadrails-6873db4699ac727dd27eedb0994ecdd976b40901.tar.gz
rails-6873db4699ac727dd27eedb0994ecdd976b40901.tar.bz2
rails-6873db4699ac727dd27eedb0994ecdd976b40901.zip
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.
Diffstat (limited to 'activesupport')
-rw-r--r--activesupport/lib/active_support/deprecation.rb2
-rw-r--r--activesupport/test/deprecation_test.rb6
2 files changed, 6 insertions, 2 deletions
diff --git a/activesupport/lib/active_support/deprecation.rb b/activesupport/lib/active_support/deprecation.rb
index 46e9996d59..24545d766c 100644
--- a/activesupport/lib/active_support/deprecation.rb
+++ b/activesupport/lib/active_support/deprecation.rb
@@ -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.
diff --git a/activesupport/test/deprecation_test.rb b/activesupport/test/deprecation_test.rb
index cd02ad3f3f..58a0a3964d 100644
--- a/activesupport/test/deprecation_test.rb
+++ b/activesupport/test/deprecation_test.rb
@@ -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