Sha256: ce703c6d7e75b90d870cce775703c52d9e05e2f5786266eac26f0739e2eefa16
Contents?: true
Size: 1.16 KB
Versions: 7
Compression:
Stored size: 1.16 KB
Contents
# _____ _ # |_ _|__ ___| |_ # | |/ _ \/ __| __| # | | __/\__ \ | # |_|\___||___/\__| # # for facets/module/name.rb require 'facets/module/name.rb' require 'test/unit' class TestModuleName < Test::Unit::TestCase def test_by_name c = ::Test::Unit::TestCase.name assert_equal( ::Test::Unit::TestCase, Module.by_name(c) ) c = "Test::Unit::TestCase" assert_equal( ::Test::Unit::TestCase, Class.by_name(c) ) end def test_basename assert_equal( "TestCase", ::Test::Unit::TestCase.basename ) end def test_dirname assert_equal( 'Test::Unit', Test::Unit::TestCase.dirname ) assert_equal( 'Test::Unit', ::Test::Unit::TestCase.dirname ) assert_equal( '', Test.dirname ) assert_equal( '', ::Test.dirname ) end def test_modspace assert_equal( Test::Unit, Test::Unit::TestCase.modspace ) assert_equal( ::Test::Unit, ::Test::Unit::TestCase.modspace ) assert_equal( Object, ::Test.modspace ) end module M module N class C def n self.class.nesting end end end end def test_nesting assert_equal( [TestModuleName, M, M::N, M::N::C], M::N::C.new.n ) end end
Version data entries
7 entries across 7 versions & 1 rubygems