proxy_wrappers_test.rb 696 字节
Newer Older
1 2 3 4 5 6
require 'abstract_unit'
require 'active_support/deprecation'

class ProxyWrappersTest < Test::Unit::TestCase
  Waffles     = false
  NewWaffles  = :hamburgers
A
Aaron Patterson 已提交
7

8 9 10 11
  def test_deprecated_object_proxy_doesnt_wrap_falsy_objects
    proxy = ActiveSupport::Deprecation::DeprecatedObjectProxy.new(nil, "message")
    assert !proxy
  end
A
Aaron Patterson 已提交
12

13 14 15 16
  def test_deprecated_instance_variable_proxy_doesnt_wrap_falsy_objects
    proxy = ActiveSupport::Deprecation::DeprecatedInstanceVariableProxy.new(nil, :waffles)
    assert !proxy
  end
A
Aaron Patterson 已提交
17

18 19 20 21
  def test_deprecated_constant_proxy_doesnt_wrap_falsy_objects
    proxy = ActiveSupport::Deprecation::DeprecatedConstantProxy.new(Waffles, NewWaffles)
    assert !proxy
  end
A
Aaron Patterson 已提交
22
end