rails--rails/activesupport/test/deprecation/proxy_wrappers_test.rb

23 lines
699 B
Ruby
Raw Normal View History

require 'abstract_unit'
require 'active_support/deprecation'
2012-01-06 01:12:46 +00:00
class ProxyWrappersTest < ActiveSupport::TestCase
Waffles = false
NewWaffles = :hamburgers
2010-07-26 16:57:29 +00:00
def test_deprecated_object_proxy_doesnt_wrap_falsy_objects
proxy = ActiveSupport::Deprecation::DeprecatedObjectProxy.new(nil, "message")
assert !proxy
end
2010-07-26 16:57:29 +00:00
def test_deprecated_instance_variable_proxy_doesnt_wrap_falsy_objects
proxy = ActiveSupport::Deprecation::DeprecatedInstanceVariableProxy.new(nil, :waffles)
assert !proxy
end
2010-07-26 16:57:29 +00:00
def test_deprecated_constant_proxy_doesnt_wrap_falsy_objects
proxy = ActiveSupport::Deprecation::DeprecatedConstantProxy.new(Waffles, NewWaffles)
assert !proxy
end
2010-07-26 16:57:29 +00:00
end