るりまサーチ

最速Rubyリファレンスマニュアル検索!
2件ヒット [1-2件を表示] (0.077秒)
トップページ > クエリ:C[x] > クエリ:teardown[x]

別のキーワード

  1. _builtin to_c
  2. etc sc_2_c_dev
  3. etc sc_2_c_bind
  4. tracer display_c_call
  5. tracer display_c_call?

検索結果

MiniTest::Unit::TestCase#teardown (21101.0)

各テストケースの実行後に実行するメソッドです。

各テストケースの実行後に実行するメソッドです。

サブクラスで再定義します。

minitest/unit (24.0)

ユニットテストを行うためのライブラリです。

...イブラリです。

=== 使い方

minitest/unit は以下のように使います。

テスト対象のソース (foo.rb) を用意します。

c
lass Foo
def foo
"foo"
end
def bar
"foo"
end
end

次にユニットテスト (test_foo.rb) を書きます。
テス...
...された後には teardown メソッドが必ず実行されます。

minitest/unit を Kernel.#require しただけではテストが自動実行されません。

require 'minitest/unit'
require 'foo'

MiniTest::Unit.autorun

c
lass TestFoo < MiniTest::Unit::TestCase
def setup...
...@foo = Foo.new
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 を省略して以下の...