Sha256: 37e503a3e5acc059021c226095a60818cc12af2fae96bd98aebe35f5e555a3b6

Contents?: true

Size: 869 Bytes

Versions: 1

Compression:

Stored size: 869 Bytes

Contents

#  _____         _
# |_   _|__  ___| |_
#   | |/ _ \/ __| __|
#   | |  __/\__ \ |_
#   |_|\___||___/\__|
#
# for lib/facets/core/module/inherit.rb
#
# Extracted Mon Jun 05 08:14:29 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.0 test/lib/facets/core/module/test_inherit.rb