別のキーワード
検索結果
-
MiniTest
:: Assertions # assert _ equal(expected , actual , message = nil) -> true (21101.0) -
与えられた期待値と実際の値が等しい場合、検査にパスしたことになります。
...セージを指定します。
文字列か Proc を指定します。Proc である場合は Proc#call した
結果を使用します。
@raise MiniTest::Assertion 与えられた期待値と実際の値が等しくない場合に発生します。
@see Object#==... -
test
/ unit (18.0) -
ユニットテストを行うためのライブラリです。
...のプロジェクトページを参照してください。
* Test::Unit - Ruby用単体テストフレームワーク: https://test-unit.github.io/
なお、2.2.0より前のtest/unit は当時バンドルしていた minitest/unit を使って再実装し
ていましたが、上記のtest/un......ase
def setup
@obj = Foo.new
end
# def teardown
# end
def test_foo
assert_equal("foo", @obj.foo)
end
def test_bar
assert_equal("bar", @obj.bar)
end
end
テストを実行するには上で用意した test_foo.rb を実......conds.
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 だけテストしたい場合は以下のようなオプションを与えます。
$ ruby test...