Sha256: e1d58c7b875eeba2cb29539db771ad50424cc3fa8a5bcb47af929be7bee98c45

Contents?: true

Size: 869 Bytes

Versions: 1

Compression:

Stored size: 869 Bytes

Contents

#  _____         _
# |_   _|__  ___| |_
#   | |/ _ \/ __| __|
#   | |  __/\__ \ |_
#   |_|\___||___/\__|
#
# for lib/facets/core/module/inherit.rb
#
# Extracted Tue Jun 06 09:30:19 EDT 2006
# Unit Tools Reap Test Extractor
#

require 'facets/core/module/inherit.rb'


  require 'test/unit'

  class TCinherit < Test::Unit::TestCase

    module Foo
      def self.x ; 10 ; end
      def y ; 20 ; end
    end

    module Bar
      inherit Foo
    end

    class X
      inherit Bar
    end

    # test

    def test_001
      assert_equal( 10, X.x )
    end

    def test_002
      x = X.new
      assert_equal( 20, x.y )
    end

    # These won't work; this solution in non-dynamic.

    #def test_004
    #  def Foo.g ; 30 ; end
    #  assert_equal( 30, Bar.g )
    #end

    #def test_005
    #  #def Foo.g ; 30 ; end
    #  assert_equal( 30, X.g )
    #end

  end


Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
facets-1.4.1 test/lib/facets/core/module/test_inherit.rb