mirror of
https://github.com/github/rails.git
synced 2026-04-26 03:00:59 -04:00
silenced writer
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4978 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
This commit is contained in:
@@ -46,6 +46,9 @@ module ActiveSupport
|
||||
@silenced = old_silenced
|
||||
end
|
||||
|
||||
attr_writer :silenced
|
||||
|
||||
|
||||
private
|
||||
def deprecation_message(callstack, message = nil)
|
||||
file, line, method = extract_callstack(callstack)
|
||||
|
||||
@@ -9,7 +9,7 @@ class Deprecatee
|
||||
def old_request; @request end
|
||||
|
||||
def partially(foo = nil)
|
||||
ActiveSupport::Deprecation.warn 'calling with foo=nil is out' if foo.nil?
|
||||
ActiveSupport::Deprecation.warn('calling with foo=nil is out', caller) if foo.nil?
|
||||
end
|
||||
|
||||
def not() 2 end
|
||||
@@ -82,5 +82,9 @@ class DeprecationTest < Test::Unit::TestCase
|
||||
ActiveSupport::Deprecation.silence do
|
||||
assert_not_deprecated { @dtc.partially }
|
||||
end
|
||||
|
||||
ActiveSupport::Deprecation.silenced = true
|
||||
assert_not_deprecated { @dtc.partially }
|
||||
ActiveSupport::Deprecation.silenced = false
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user