aboutsummaryrefslogblamecommitdiffstats
path: root/activesupport/test/deprecation/proxy_wrappers_test.rb
blob: 9e26052fb47dd0c251272dd7c1765e2e1f5f676e (plain) (tree)
1
2
3
4
5
6
7
8
9
                             
 

                                    
 
                                                 

                           
 

                                                                                 
                    
     
 

                                                                                          
                    
     
 

                                                                                        
                    
     
   
# frozen_string_literal: true

require "abstract_unit"
require "active_support/deprecation"

class ProxyWrappersTest < ActiveSupport::TestCase
  Waffles     = false
  NewWaffles  = :hamburgers

  def test_deprecated_object_proxy_doesnt_wrap_falsy_objects
    proxy = ActiveSupport::Deprecation::DeprecatedObjectProxy.new(nil, "message")
    assert_not proxy
  end

  def test_deprecated_instance_variable_proxy_doesnt_wrap_falsy_objects
    proxy = ActiveSupport::Deprecation::DeprecatedInstanceVariableProxy.new(nil, :waffles)
    assert_not proxy
  end

  def test_deprecated_constant_proxy_doesnt_wrap_falsy_objects
    proxy = ActiveSupport::Deprecation::DeprecatedConstantProxy.new(Waffles, NewWaffles)
    assert_not proxy
  end
end