Test::Unitを使っているんだけどassert
のタイプ何があったっけなと毎回調べてるのでまとめておく
参照 : http://ruby-doc.org/stdlib-2.1.0/libdoc/test/unit/rdoc/Test/Unit/Assertions.html
大体こんだけ
assert
assert_block
assert_equal
assert_no_match
assert_not_equal
assert_not_nil
assert_not_same
assert_not_send
assert_nothing_raised
assert_nothing_thrown
assert_raise
assert_raise_with_message
assert_respond_to
assert_send
assert_throw
使い方は下記
assert(test, [failure_message])
assert_block( failure_message = nil )
assert_equal( expected, actual, failure_message = nil )
assert_no_match( regexp, string, failure_message = nil )
assert_not_equal( expected, actual, failure_message = nil )
assert_not_nil( expression, failure_message = nil )
assert_not_same( expected, actual, failure_message = nil )
assert_not_send( +send_array+, failure_message = nil )
assert_nothing_raised( *args, &block )
assert_nothing_thrown( failure_message = nil, &block )
assert_raise( *args, &block )
assert_raise_with_message(exception, expected, msg = nil, &block)
assert_respond_to( object, method, failure_message = nil )
assert_send( +send_array+, failure_message = nil )
assert_throw( tag, failure_message = nil, &block )