mirror of
https://github.com/github/rails.git
synced 2026-01-30 16:58:15 -05:00
Remove unnecessary DeprecatedInstanceVariable class
This commit is contained in:
@@ -176,23 +176,6 @@ module ActiveSupport
|
||||
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 @@ class DeprecationTest < Test::Unit::TestCase
|
||||
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
|
||||
|
||||
Reference in New Issue
Block a user