Skip to content

Commit

Permalink
Test to ensure that falsy objects aren't wrapped by deprecation proxies
Browse files Browse the repository at this point in the history
  • Loading branch information
Leigh Caplan authored and tenderlove committed Jul 26, 2010
1 parent a9ef2fd commit 27651c1
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions activesupport/test/deprecation/proxy_wrappers_test.rb
Original file line number Diff line number Diff line change
@@ -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 27651c1

Please sign in to comment.