53
49

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Test::Unitのassert一覧

Posted at

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 )
53
49
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
53
49

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?