Browse files

Test to ensure that falsy objects aren't wrapped by deprecation proxies

  • Loading branch information...
1 parent e56c9ef commit 37d82f2ca0f8e81d473969586e70826f27538072 @texel texel committed with tenderlove Jul 21, 2010
Showing with 22 additions and 0 deletions.
  1. +22 −0 activesupport/test/deprecation/proxy_wrappers_test.rb
View
22 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

0 comments on commit 37d82f2

Please sign in to comment.