別のキーワード
種類
- インスタンスメソッド (2)
- ライブラリ (2)
ライブラリ
-
minitest
/ spec (1) -
minitest
/ unit (1)
クラス
- Module (1)
モジュール
キーワード
-
infect
_ with _ assertions (1) -
minitest
/ unit (1) -
test
/ unit (1)
検索結果
先頭4件
-
MiniTest
:: Assertions # skip(message = nil , backtrace = caller) (21107.0) -
このメソッドを呼び出したテストメソッドをスキップします。
...ます。
@param message メッセージを指定します。
@param backtrace 例外発生時のスタックトレースで、Kernel.#caller の戻り値と同じ
形式で指定しなければいけません。
@raise MiniTest::Skip 必ず発生します。
@see Kernel.#raise... -
Module
# infect _ with _ assertions(positive _ prefix , negative _ prefix , skip _ regexp , map = {}) -> () (6213.0) -
BDD 風にテストを書くために使用するメソッド群を定義します。
...するメソッド群を定義します。
@param positive_prefix assert の代わりのプレフィックスを指定します。
@param negative_prefix refute の代わりのプレフィックスを指定します。
@param skip_regexp この正規表現にマッチしたメソッドは定義... -
minitest
/ unit (30.0) -
ユニットテストを行うためのライブラリです。
...ew
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 を省略して以下のように書く......inished 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_ba......inished 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 (18.0) -
ユニットテストを行うためのライブラリです。
...stCase
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 を......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_foo.rb --na......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 も表示されます。
$ ruby te...