Sha256: cdd538f2dd539c3029e88c12db765131451e090ef9a96231a450f061f30c6081
Contents?: true
Size: 741 Bytes
Versions: 26
Compression:
Stored size: 741 Bytes
Contents
class String # Removes prepend module namespace. # # "Test::Unit".basename #=> "Unit" # def basename self.to_s.gsub(/^.*::/, '') end end # _____ _ # |_ _|__ ___| |_ # | |/ _ \/ __| __| # | | __/\__ \ |_ # |_|\___||___/\__| # =begin test require 'test/unit' class TCString < Test::Unit::TestCase def test_001 assert_equal( "Unit", "Test::Unit".basename ) end def test_002 a = "Down::Bottom" assert_raises( ArgumentError ) { a.basename(1) } end def test_003 a = "Down::Bottom" assert_equal( "Bottom", a.basename ) end def test_004 b = "Further::Down::Bottom" assert_equal( "Bottom", b.basename ) end end =end
Version data entries
26 entries across 26 versions & 1 rubygems