るりまサーチ

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

別のキーワード

  1. optionparser on
  2. optparse on
  3. tracer on
  4. socket udp_server_loop_on
  5. thread abort_on_exception

ライブラリ

モジュール

検索結果

MiniTest::Assertions#assert_equal(expected, actual, message = nil) -> true (21201.0)

与えられた期待値と実際の値が等しい場合、検査にパスしたことになります。

...セージを指定します。
文字列か Proc を指定します。Proc である場合は Proc#call した
結果を使用します。

@raise MiniTest::Assertion 与えられた期待値と実際の値が等しくない場合に発生します。

@see Object#==...

test/unit (144.0)

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

...なりまし
た。詳しい内容は下記のプロジェクトページを参照してください。

* Test::Unit - Ruby用単体テストフレームワーク: https://test-unit.github.io/

なお、2.2.0より前のtest/unit は当時バンドルしていた minitest/unit を使って再実...
...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 を実...
...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 だけテストしたい場合...