Sha256: 581f2c671bb6187c7a2212f118f2e5d01193028906f5e988260d363e5ddace04

Contents?: true

Size: 1.05 KB

Versions: 1

Compression:

Stored size: 1.05 KB

Contents

#  _____         _
# |_   _|__  ___| |_
#   | |/ _ \/ __| __|
#   | |  __/\__ \ |_
#   |_|\___||___/\__|
#
# for lib/facets/more/classmethods.rb
#
# Extracted Wed Jul 05 11:47:50 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.5 test/lib/facets/more/test_classmethods.rb