Sha256: 444b89c95e4931a3e47643c24fbcc96b06d513b4e3595ddd6f26be693b0db079

Contents?: true

Size: 1.05 KB

Versions: 1

Compression:

Stored size: 1.05 KB

Contents

#  _____         _
# |_   _|__  ___| |_
#   | |/ _ \/ __| __|
#   | |  __/\__ \ |_
#   |_|\___||___/\__|
#
# for lib/facets/more/classmethods.rb
#
# Extracted Mon Jul 03 00:56:56 EDT 2006
# Unit Tools Reap Test Extractor
#

require 'facets/more/classmethods.rb'


  require 'test/unit'

  class TC_ClassMethods < Test::Unit::TestCase

    # fixture

    module N
      class_methods do
        def n ; 43 ; end
        def s ; self ; end
      end
    end

    class X
      include N
      def n ; 11 ; end
    end

    module K
      include N
      class_methods do
        def n ; super + 1 ; end
      end
    end

    class Z
      include K
    end

    # tests

    def test_01
      assert_equal( 43, N.n )
      assert_equal(  N,  N.s )
    end
    def test_02
      assert_equal( 43, X.n )
      assert_equal(  X, X.s )
    end
    def test_03
      assert_equal( 11, X.new.n )
    end
    def test_04
      assert_equal( 44, K.n )
      assert_equal(  K, K.s )
    end
    def test_05
      assert_equal( 44, Z.n )
      assert_equal(  Z, Z.s )
    end

  end


Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
facets-1.4.4 test/lib/facets/more/test_classmethods.rb