forked from rails/rails
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Test to ensure that falsy objects aren't wrapped by deprecation proxies
- Loading branch information
1 parent
a9ef2fd
commit 27651c1
Showing
1 changed file
with
22 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |