Sha256: 52f76577d1681a224902d458a44e85972e7249e7eca83c8b0391740f299abe5f
Contents?: true
Size: 1.06 KB
Versions: 9
Compression:
Stored size: 1.06 KB
Contents
# _____ _ # |_ _|__ ___| |_ # | |/ _ \/ __| __| # | | __/\__ \ | # |_|\___||___/\__| # # for lib/facets/classmethods.rb # # Extracted Mon Sep 03 16:23:07 -0700 2007 # w/ Test Extraction Ratchet # require 'facets/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
9 entries across 9 versions & 1 rubygems