るりまサーチ

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

別のキーワード

  1. mkmf try_static_assert
  2. kernel try_static_assert
  3. try_static_assert kernel
  4. try_static_assert mkmf
  5. power_assert

ライブラリ

モジュール

検索結果

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

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

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

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

@see Object#==...

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 を実...
...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 だけテストしたい場合...
...d suite test_foo
Started
F
Finished in 0.019573 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のような指定は行...