From: Ryan Davis Date: 2009-05-15T05:17:15+09:00 Subject: Re: How can I use the "test/unit" right On May 14, 2009, at 06:15 , artoxvw@gmail.com wrote: > when I run the following code > > require 'test/unit' > class TC_Pram < Test::Unit::TestCase > def initialize(name) > @name=name > end > def test_array > puts assert_equal(2,@name[2]) > end > end > tc=TC_Pram.new("wang") > tc.test_array require 'test/unit' class TC_Pram < Test::Unit::TestCase def setup @name = "wang" end def test_array assert_equal ?n, @name[2] end end --- nothing more. don't add puts. don't instantiate or call the method. just run it with ruby. "require 'test/unit'" will take care of the rest. I changed your assertion so that it'll pass. you may not have wanted that.