Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

fix failure if behavior is not define and try use the default

Signed-off-by: José Valim <jose.valim@gmail.com>
  • Loading branch information...
commit 9024545a6b019e3a2596a4194e84e77963e31b05 1 parent e596a8e
@shingara shingara authored josevalim committed
View
2  activesupport/lib/active_support/deprecation/behaviors.rb
@@ -8,7 +8,7 @@ class << self
attr_accessor :debug
def behavior
- @behavior ||= DEFAULT_BEHAVIORS[:stderr]
+ @behavior ||= [DEFAULT_BEHAVIORS[:stderr]]
end
def behavior=(behavior)
View
7 activesupport/test/deprecation_test.rb
@@ -136,6 +136,13 @@ def test_assert_deprecated_returns_result_of_block
assert_equal 123, result
end
+ def test_assert_deprecated_warn_work_with_default_behavior
+ ActiveSupport::Deprecation.instance_variable_set('@behavior' , nil)
+ assert_deprecated('abc') do
+ ActiveSupport::Deprecation.warn 'abc'
+ end
+ end
+
def test_silence
ActiveSupport::Deprecation.silence do
assert_not_deprecated { @dtc.partially }
Please sign in to comment.
Something went wrong with that request. Please try again.