aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLeigh Caplan <lcaplan@onehub.com>2010-07-21 16:51:15 -0700
committerAaron Patterson <aaron.patterson@gmail.com>2010-07-26 09:53:42 -0700
commit37d82f2ca0f8e81d473969586e70826f27538072 (patch)
tree313660c2faa2e57d6f156e2e37e2b48a4f1b1aa3
parente56c9ef08db49653f0c63a0305d563b2514b266b (diff)
downloadrails-37d82f2ca0f8e81d473969586e70826f27538072.tar.gz
rails-37d82f2ca0f8e81d473969586e70826f27538072.tar.bz2
rails-37d82f2ca0f8e81d473969586e70826f27538072.zip
Test to ensure that falsy objects aren't wrapped by deprecation proxies
-rw-r--r--activesupport/test/deprecation/proxy_wrappers_test.rb22
1 files changed, 22 insertions, 0 deletions
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