From 37d82f2ca0f8e81d473969586e70826f27538072 Mon Sep 17 00:00:00 2001 From: Leigh Caplan Date: Wed, 21 Jul 2010 16:51:15 -0700 Subject: Test to ensure that falsy objects aren't wrapped by deprecation proxies --- .../test/deprecation/proxy_wrappers_test.rb | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 activesupport/test/deprecation/proxy_wrappers_test.rb (limited to 'activesupport/test/deprecation/proxy_wrappers_test.rb') diff --git a/activesupport/test/deprecation/proxy_wrappers_test.rb b/activesupport/test/deprecation/proxy_wrappers_test.rb new file mode 100644 index 0000000000..c507eff38e --- /dev/null +++ b/activesupport/test/deprecation/proxy_wrappers_test.rb @@ -0,0 +1,22 @@ +require 'abstract_unit' +require 'active_support/deprecation' + +class ProxyWrappersTest < Test::Unit::TestCase + Waffles = false + NewWaffles = :hamburgers + + def test_deprecated_object_proxy_doesnt_wrap_falsy_objects + proxy = ActiveSupport::Deprecation::DeprecatedObjectProxy.new(nil, "message") + assert !proxy + end + + def test_deprecated_instance_variable_proxy_doesnt_wrap_falsy_objects + proxy = ActiveSupport::Deprecation::DeprecatedInstanceVariableProxy.new(nil, :waffles) + assert !proxy + end + + def test_deprecated_constant_proxy_doesnt_wrap_falsy_objects + proxy = ActiveSupport::Deprecation::DeprecatedConstantProxy.new(Waffles, NewWaffles) + assert !proxy + end +end \ No newline at end of file -- cgit v1.2.3