簡単なコードであれば、テストコードも簡単なものになるのでassert_equalが使えれば十分だったりします。
No it's not a best practice. The best analogy to assert() in Ruby is just raising raise "This is wrong" unless expr
solid_assert is a simple implementation of an assert utility in Ruby. It lets you write tests for your assumptions while coding.
test-unitはRuby用のxUnit系の単体テストフレームワークです。
Ruby 2.2にはRuby 1.9.1のときに外されたtest-unitというテスティングフレームワークが再びバンドルされる予定です。Rubyのテスティングフレームワーク周りに詳しくない人にはよくわからない状況でしょう。そこで、Rubyのテスティングフレームワークの歴史を説明することで状況を整理します。
Since ruby 1.9 the ruby standard library has included a testing framework called MiniTest, it is a modern and lightweight replacement for ruby 1.8's Test::Unit framework.
putsやgetsを使っているaskメソッドをテストするには、IOオブジェクトのように振舞うオブジェクトを使えばいい。
WebMockというGemを使うと、外部へのHTTPリクエストをスタブ化してくれるので、開発が非常にやりやすくなります。