2010-07-21 19:51:15 -04:00
|
|
|
require 'abstract_unit'
|
|
|
|
require 'active_support/deprecation'
|
|
|
|
|
|
|
|
class ProxyWrappersTest < Test::Unit::TestCase
|
|
|
|
Waffles = false
|
|
|
|
NewWaffles = :hamburgers
|
2010-07-26 12:57:29 -04:00
|
|
|
|
2010-07-21 19:51:15 -04:00
|
|
|
def test_deprecated_object_proxy_doesnt_wrap_falsy_objects
|
|
|
|
proxy = ActiveSupport::Deprecation::DeprecatedObjectProxy.new(nil, "message")
|
|
|
|
assert !proxy
|
|
|
|
end
|
2010-07-26 12:57:29 -04:00
|
|
|
|
2010-07-21 19:51:15 -04:00
|
|
|
def test_deprecated_instance_variable_proxy_doesnt_wrap_falsy_objects
|
|
|
|
proxy = ActiveSupport::Deprecation::DeprecatedInstanceVariableProxy.new(nil, :waffles)
|
|
|
|
assert !proxy
|
|
|
|
end
|
2010-07-26 12:57:29 -04:00
|
|
|
|
2010-07-21 19:51:15 -04:00
|
|
|
def test_deprecated_constant_proxy_doesnt_wrap_falsy_objects
|
|
|
|
proxy = ActiveSupport::Deprecation::DeprecatedConstantProxy.new(Waffles, NewWaffles)
|
|
|
|
assert !proxy
|
|
|
|
end
|
2010-07-26 12:57:29 -04:00
|
|
|
end
|