別のキーワード
種類
- インスタンスメソッド (2)
- ライブラリ (2)
ライブラリ
-
minitest
/ spec (1) -
minitest
/ unit (1)
クラス
- Object (1)
モジュール
キーワード
-
minitest
/ unit (1) -
must
_ equal (1) -
test
/ unit (1)
検索結果
先頭4件
-
MiniTest
:: Assertions # assert _ equal(expected , actual , message = nil) -> true (27202.0) -
与えられた期待値と実際の値が等しい場合、検査にパスしたことになります。
...セージを指定します。
文字列か Proc を指定します。Proc である場合は Proc#call した
結果を使用します。
@raise MiniTest::Assertion 与えられた期待値と実際の値が等しくない場合に発生します。
@see Object#==... -
minitest
/ unit (24.0) -
ユニットテストを行うためのライブラリです。
...end
# teardown はあまり使わない
def teardown
@foo = nil
end
def test_foo
assert_equal "foo", @foo.foo
end
def test_bar
assert_equal "bar", @foo.bar
end
end
または MiniTest::Unit.autorun を省略して以下のように書くこ......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_......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
コンソールを使った testrunner のみ提供されています。
またヘルプを表示すること... -
test
/ unit (24.0) -
ユニットテストを行うためのライブラリです。
...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 を実......23 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 だけテストしたい場合は以下のようなオプションを与えます。
$ ruby......73 seconds.
1) Failure:
test_bar(TC_Foo) [test_foo.rb:16]:
<"bar"> expected but was
<"foo">.
1 tests, 1 assertions, 1 failures, 0 errors, 0 skips
--name=test_barのような指定は行えません。
以下のようにすると help も表示されま... -
Object
# must _ equal(expected) -> true (12.0) -
自身が比較対象のオブジェクトと等しい場合、検査にパスしたことになります。
...しい場合、検査にパスしたことになります。
@param expected 比較対象のオブジェクトを指定します。
@raise MiniTest::Assertion 与えられた期待値と実際の値が等しくない場合に発生します。
@see Object#==, MiniTest::Assertions#assert_equal...