# _____ _ # |_ _|__ ___| |_ # | |/ _ \/ __| __| # | | __/\__ \ |_ # |_|\___||___/\__| # # for lib/nano/kernel/singleton.rb # # Extracted Fri Oct 28 14:20:18 EDT 2005 # Unit Tools Reap Test Extractor # require 'nano/kernel/singleton.rb' require 'test/unit' class TCKernel < Test::Unit::TestCase def test_singleton o = Object.new assert_equal( (class << o; self; end), o.singleton ) end #def test_singleton_eval # assert_nothing_raised do # o.singleton_class_eval{ @@a = "test" } # end #end #def test_singleton_method # assert_nothing_raised do # o.define_singleton_method(:testing){ |x| x + 1 } # end # assert_equal(2, o.testing(1) ) #end end