Ruby 1.9.2 リファレンスマニュアル > ライブラリ一覧 > test/unit/assertionsライブラリ > Test::Unit::Assertionsモジュール > assert_throws

instance method Test::Unit::Assertions#assert_throws

assert_throws(expected_symbol, message="") { ... } -> ()

ブロックを実行して :expected_symbol が throw されたらパスします。

[EXCEPTION] Test::Unit::AssertionFailedError:
assert が失敗した時に発生します。