提交 2270371f 编写于 作者: P Pratik Naik

Remove unnecessary DeprecatedInstanceVariable class

上级 593e21d6
......@@ -176,23 +176,6 @@ def warn(callstack, called, args)
end
end
class DeprecatedInstanceVariable < Delegator #:nodoc:
def initialize(value, method)
@method = method
super(value)
__setobj__(value)
end
def __getobj__
ActiveSupport::Deprecation.warn("Instance variable @#{@method} is deprecated! Call instance method #{@method} instead.")
@value
end
def __setobj__(value)
@value = value
end
end
end
end
......
......@@ -149,13 +149,3 @@ def message
assert_nil @last_message
end
end
class DeprecatedIvarTest < Test::Unit::TestCase
def test_deprecated_ivar
@action = ActiveSupport::Deprecation::DeprecatedInstanceVariable.new("fubar", :foobar)
assert_deprecated(/Instance variable @foobar is deprecated! Call instance method foobar instead/) { assert_equal "fubar", @action }
end
end
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册