種類
- ライブラリ (2)
- インスタンスメソッド (1)
ライブラリ
-
minitest
/ unit (1)
クラス
-
MiniTest
:: Unit (1)
キーワード
-
minitest
/ unit (1) -
test
/ unit (1)
検索結果
-
MiniTest
:: Unit # failures -> Fixnum (24301.0) -
失敗したアサーション数を返します。
失敗したアサーション数を返します。 -
test
/ unit (6132.0) -
ユニットテストを行うためのライブラリです。
...してください。
* Test::Unit - Ruby用単体テストフレームワーク: https://test-unit.github.io/
なお、2.2.0より前のtest/unit は当時バンドルしていた minitest/unit を使って再実装し
ていましたが、上記のtest/unitと完全な互換性がある訳で......グフレームワークの歴史(2014年版) https://www.clear-code.com/blog/2014/11/6.html
* RubyKaigi 2015:The history of testing framework in Ruby https://www.clear-code.com/blog/2015/12/12.html
=== 使い方
Test::Unit は以下のように使います。
まずテスト対象のソ......oo.rb
Loaded suite test_foo
Started
F.
Finished in 0.022223 seconds.
1) Failure:
test_bar(TC_Foo) [test_foo.rb:16]:
<"bar"> expected but was
<"foo">.
2 tests, 2 assertions, 1 failures, 0 errors, 0 skips
test_bar だけテ... -
minitest
/ unit (6030.0) -
ユニットテストを行うためのライブラリです。
...ユニットテストを行うためのライブラリです。
=== 使い方
minitest/unit は以下のように使います。
テスト対象のソース (foo.rb) を用意します。
class Foo
def foo
"foo"
end
def bar
"foo"
end
end
次にユニットテス......されます。
$ ruby test_foo.rb
Loaded suite test_foo
Started
F.
Finished in 0.000940 seconds.
1) Failure:
test_bar(TestFoo) [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 seconds.
1) Failure:
test_bar(TestFoo) [test_foo.rb:20]:
Expected "bar", not "foo".
1 tests, 1 assertions, 1 failures, 0 errors, 0 skips
コンソールを使った testrun...