用测试的方式来学习Ruby,有点意思!
require 'test/unit'
class StringTest < Test::Unit::TestCase
def test_length
s = "Hello, World!"
assert_equal(13, s.length)
end
end
这就是一个简单的测试,够简单吧!
原文出自http://www.clarkware.com/cgi/blosxom/2005/03/18#RLT1
require 'test/unit'
class StringTest < Test::Unit::TestCase
def test_length
s = "Hello, World!"
assert_equal(13, s.length)
end
end
这就是一个简单的测试,够简单吧!
原文出自http://www.clarkware.com/cgi/blosxom/2005/03/18#RLT1