Sha256: a3634e73125c6545a1638ebf42edae5a2ca8c9589cd2f8440e6e84e6b8a1a595

Contents?: true

Size: 1.48 KB

Versions: 1

Compression:

Stored size: 1.48 KB

Contents

#  _____         _
# |_   _|__  ___| |_
#   | |/ _ \/ __| __|
#   | |  __/\__ \ |_
#   |_|\___||___/\__|
#
# for lib/facets/more/basicobject.rb
#
# Extracted Fri Feb 16 02:00:36 EST 2007
# Project.rb Test Extraction
#

require 'facets/more/basicobject.rb'


  require 'test/unit'

  class TCBasicObject < Test::Unit::TestCase

    class A < BasicObject
    end

    def setup
      @a = A.new
    end

    def test_001
      assert( ! @a.object_class.method_defined?( :id ) )
      assert( ! @a.object_class.method_defined?( :class ) )
    end

    def test_002
      assert( @a.object_class.method_defined?( :__id__ ) )
      assert( @a.object_class.method_defined?( :__send__ ) )
      assert( @a.object_class.method_defined?( :object_self ) )
      assert( @a.object_class.method_defined?( :dup ) )
      assert( @a.object_class.method_defined?( :as ) )
    end

    def test_003
      assert_equal( A, @a.object_self.class )
    end

    def test_004
      Kernel.module_eval { def xxx ; end }
      assert( ! @a.object_class.method_defined?( :xxx ) )
    end

    def test_005
      Object.class_eval { def yyy ; end }
      assert( ! @a.object_class.method_defined?( :yyy ) )
    end

    def test_006
      Object.class_eval { def yyy ; end }
      assert( ! @a.object_self.methods.include?( 'yyy' ) )
    end

    def test_007
      Object.class_eval { def yyy ; end }
      assert( ! @a.object_class.method_defined?( :methods ) )
      assert( ! @a.object_self.methods.include?( :methods ) )
    end

  end


Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
facets-1.8.49 test/lib/facets/more/test_basicobject.rb