種類
- ライブラリ (2)
- インスタンスメソッド (1)
ライブラリ
-
minitest
/ unit (1)
クラス
-
MiniTest
:: Unit (1)
キーワード
-
minitest
/ unit (1) -
test
/ unit (1)
検索結果
-
MiniTest
:: Unit # failures -> Fixnum (21201.0) -
失敗したアサーション数を返します。
失敗したアサーション数を返します。 -
test
/ unit (6132.0) -
ユニットテストを行うためのライブラリです。
...2.2.0 からbundled gem(gemファイルのみを同梱)になりまし
た。詳しい内容は下記のプロジェクトページを参照してください。
* Test::Unit - Ruby用単体テストフレームワーク: https://test-unit.github.io/
なお、2.2.0より前のtest/unit は当時......バンドルしていた minitest/unit を使って再実装し
ていましたが、上記のtest/unitと完全な互換性がある訳ではありません。
Rubyのテスティングフレームワークの歴史については以下が詳しくまとまっています。
* Rubyのテステ......bar"> expected but was
<"foo">.
2 tests, 2 assertions, 1 failures, 0 errors, 0 skips
test_bar だけテストしたい場合は以下のようなオプションを与えます。
$ ruby test_foo.rb --name test_bar
Loaded suite test_foo
Started
F... -
minitest
/ unit (6030.0) -
ユニットテストを行うためのライブラリです。
...ユニットテストを行うためのライブラリです。
=== 使い方
minitest/unit は以下のように使います。
テスト対象のソース (foo.rb) を用意します。
class Foo
def foo
"foo"
end
def bar
"foo"
end
end
次にユニットテス......[test_foo.rb:20]:
Expected "bar", not "foo".
2 tests, 2 assertions, 1 failures, 0 errors, 0 skips
test_bar だけテストしたい場合は以下のようなオプションを与えます。
$ ruby test_foo.rb -n test_bar
Loaded suite test_foo
Started
F
Finished in 0.000820 seco......1 tests, 1 assertions, 1 failures, 0 errors, 0 skips
コンソールを使った testrunner のみ提供されています。
またヘルプを表示することもできません。
=== 使用可能なオプション
: -v
詳細を表示します。
: -n, --name
指定されたテス...