Module: MiniTest::Expectations
- Included in:
- Object
- Defined in:
- lib/minitest/spec.rb
Overview
It’s where you hide your “assertions”.
Instance Method Summary collapse
-
#assert_empty ⇒ Object
See MiniTest::Assertions#assert_empty.
-
#assert_equal ⇒ Object
See MiniTest::Assertions#assert_equal.
-
#assert_in_delta ⇒ Object
See MiniTest::Assertions#assert_in_delta.
-
#assert_in_epsilon ⇒ Object
See MiniTest::Assertions#assert_in_epsilon.
-
#assert_includes ⇒ Object
See MiniTest::Assertions#assert_includes.
-
#assert_instance_of ⇒ Object
See MiniTest::Assertions#assert_instance_of.
-
#assert_kind_of ⇒ Object
See MiniTest::Assertions#assert_kind_of.
-
#assert_match ⇒ Object
See MiniTest::Assertions#assert_match.
-
#assert_nil ⇒ Object
See MiniTest::Assertions#assert_nil.
-
#assert_operator ⇒ Object
See MiniTest::Assertions#assert_operator.
-
#assert_output ⇒ Object
See MiniTest::Assertions#assert_output.
-
#assert_raises ⇒ Object
See MiniTest::Assertions#assert_raises.
-
#assert_respond_to ⇒ Object
See MiniTest::Assertions#assert_respond_to.
-
#assert_same ⇒ Object
See MiniTest::Assertions#assert_same.
-
#assert_send ⇒ Object
See MiniTest::Assertions#assert_send TODO: remove me.
-
#assert_silent ⇒ Object
See MiniTest::Assertions#assert_silent.
-
#assert_throws ⇒ Object
See MiniTest::Assertions#assert_throws.
-
#refute_empty ⇒ Object
See MiniTest::Assertions#refute_empty.
-
#refute_equal ⇒ Object
See MiniTest::Assertions#refute_equal.
-
#refute_in_delta ⇒ Object
See MiniTest::Assertions#refute_in_delta.
-
#refute_in_epsilon ⇒ Object
See MiniTest::Assertions#refute_in_epsilon.
-
#refute_includes ⇒ Object
See MiniTest::Assertions#refute_includes.
-
#refute_instance_of ⇒ Object
See MiniTest::Assertions#refute_instance_of.
-
#refute_kind_of ⇒ Object
See MiniTest::Assertions#refute_kind_of.
-
#refute_match ⇒ Object
See MiniTest::Assertions#refute_match.
-
#refute_nil ⇒ Object
See MiniTest::Assertions#refute_nil.
-
#refute_operator ⇒ Object
See MiniTest::Assertions#refute_operator.
-
#refute_respond_to ⇒ Object
See MiniTest::Assertions#refute_respond_to.
-
#refute_same ⇒ Object
See MiniTest::Assertions#refute_same.
Instance Method Details
#assert_empty ⇒ Object
See MiniTest::Assertions#assert_empty.
collection.must_be_empty
:method: must_be_empty
274 |
# File 'lib/minitest/spec.rb', line 274 infect_an_assertion :assert_empty, :must_be_empty, :unary |
#assert_equal ⇒ Object
See MiniTest::Assertions#assert_equal
a.must_equal b
:method: must_equal
283 |
# File 'lib/minitest/spec.rb', line 283 infect_an_assertion :assert_equal, :must_equal |
#assert_in_delta ⇒ Object
See MiniTest::Assertions#assert_in_delta
n.must_be_close_to m [, delta]
:method: must_be_close_to
292 |
# File 'lib/minitest/spec.rb', line 292 infect_an_assertion :assert_in_delta, :must_be_close_to |
#assert_in_epsilon ⇒ Object
See MiniTest::Assertions#assert_in_epsilon
n.must_be_within_epsilon m [, epsilon]
:method: must_be_within_epsilon
303 |
# File 'lib/minitest/spec.rb', line 303 infect_an_assertion :assert_in_epsilon, :must_be_within_epsilon |
#assert_includes ⇒ Object
See MiniTest::Assertions#assert_includes
collection.must_include obj
:method: must_include
312 |
# File 'lib/minitest/spec.rb', line 312 infect_an_assertion :assert_includes, :must_include, :reverse |
#assert_instance_of ⇒ Object
See MiniTest::Assertions#assert_instance_of
obj.must_be_instance_of klass
:method: must_be_instance_of
321 |
# File 'lib/minitest/spec.rb', line 321 infect_an_assertion :assert_instance_of, :must_be_instance_of |
#assert_kind_of ⇒ Object
See MiniTest::Assertions#assert_kind_of
obj.must_be_kind_of mod
:method: must_be_kind_of
330 |
# File 'lib/minitest/spec.rb', line 330 infect_an_assertion :assert_kind_of, :must_be_kind_of |
#assert_match ⇒ Object
See MiniTest::Assertions#assert_match
a.must_match b
:method: must_match
339 |
# File 'lib/minitest/spec.rb', line 339 infect_an_assertion :assert_match, :must_match |
#assert_nil ⇒ Object
See MiniTest::Assertions#assert_nil
obj.must_be_nil
:method: must_be_nil
348 |
# File 'lib/minitest/spec.rb', line 348 infect_an_assertion :assert_nil, :must_be_nil, :unary |
#assert_operator ⇒ Object
See MiniTest::Assertions#assert_operator
n.must_be :<=, 42
This can also do predicates:
str.must_be :empty?
:method: must_be
361 |
# File 'lib/minitest/spec.rb', line 361 infect_an_assertion :assert_operator, :must_be, :reverse |
#assert_output ⇒ Object
See MiniTest::Assertions#assert_output
proc { ... }.must_output out_or_nil [, err]
:method: must_output
370 |
# File 'lib/minitest/spec.rb', line 370 infect_an_assertion :assert_output, :must_output |
#assert_raises ⇒ Object
See MiniTest::Assertions#assert_raises
proc { ... }.must_raise exception
:method: must_raise
379 |
# File 'lib/minitest/spec.rb', line 379 infect_an_assertion :assert_raises, :must_raise |
#assert_respond_to ⇒ Object
See MiniTest::Assertions#assert_respond_to
obj.must_respond_to msg
:method: must_respond_to
388 |
# File 'lib/minitest/spec.rb', line 388 infect_an_assertion :assert_respond_to, :must_respond_to, :reverse |
#assert_same ⇒ Object
See MiniTest::Assertions#assert_same
a.must_be_same_as b
:method: must_be_same_as
397 |
# File 'lib/minitest/spec.rb', line 397 infect_an_assertion :assert_same, :must_be_same_as |
#assert_send ⇒ Object
See MiniTest::Assertions#assert_send TODO: remove me
a.must_send
:method: must_send
407 |
# File 'lib/minitest/spec.rb', line 407 infect_an_assertion :assert_send, :must_send |
#assert_silent ⇒ Object
See MiniTest::Assertions#assert_silent
proc { ... }.must_be_silent
:method: must_be_silent
416 |
# File 'lib/minitest/spec.rb', line 416 infect_an_assertion :assert_silent, :must_be_silent |
#assert_throws ⇒ Object
See MiniTest::Assertions#assert_throws
proc { ... }.must_throw sym
:method: must_throw
425 |
# File 'lib/minitest/spec.rb', line 425 infect_an_assertion :assert_throws, :must_throw |
#refute_empty ⇒ Object
See MiniTest::Assertions#refute_empty
collection.wont_be_empty
:method: wont_be_empty
434 |
# File 'lib/minitest/spec.rb', line 434 infect_an_assertion :refute_empty, :wont_be_empty, :unary |
#refute_equal ⇒ Object
See MiniTest::Assertions#refute_equal
a.wont_equal b
:method: wont_equal
443 |
# File 'lib/minitest/spec.rb', line 443 infect_an_assertion :refute_equal, :wont_equal |
#refute_in_delta ⇒ Object
See MiniTest::Assertions#refute_in_delta
n.wont_be_close_to m [, delta]
:method: wont_be_close_to
452 |
# File 'lib/minitest/spec.rb', line 452 infect_an_assertion :refute_in_delta, :wont_be_close_to |
#refute_in_epsilon ⇒ Object
See MiniTest::Assertions#refute_in_epsilon
n.wont_be_within_epsilon m [, epsilon]
:method: wont_be_within_epsilon
463 |
# File 'lib/minitest/spec.rb', line 463 infect_an_assertion :refute_in_epsilon, :wont_be_within_epsilon |
#refute_includes ⇒ Object
See MiniTest::Assertions#refute_includes
collection.wont_include obj
:method: wont_include
472 |
# File 'lib/minitest/spec.rb', line 472 infect_an_assertion :refute_includes, :wont_include, :reverse |
#refute_instance_of ⇒ Object
See MiniTest::Assertions#refute_instance_of
obj.wont_be_instance_of klass
:method: wont_be_instance_of
481 |
# File 'lib/minitest/spec.rb', line 481 infect_an_assertion :refute_instance_of, :wont_be_instance_of |
#refute_kind_of ⇒ Object
See MiniTest::Assertions#refute_kind_of
obj.wont_be_kind_of mod
:method: wont_be_kind_of
490 |
# File 'lib/minitest/spec.rb', line 490 infect_an_assertion :refute_kind_of, :wont_be_kind_of |
#refute_match ⇒ Object
See MiniTest::Assertions#refute_match
a.wont_match b
:method: wont_match
499 |
# File 'lib/minitest/spec.rb', line 499 infect_an_assertion :refute_match, :wont_match |
#refute_nil ⇒ Object
See MiniTest::Assertions#refute_nil
obj.wont_be_nil
:method: wont_be_nil
508 |
# File 'lib/minitest/spec.rb', line 508 infect_an_assertion :refute_nil, :wont_be_nil, :unary |
#refute_operator ⇒ Object
See MiniTest::Assertions#refute_operator
n.wont_be :<=, 42
This can also do predicates:
str.wont_be :empty?
:method: wont_be
521 |
# File 'lib/minitest/spec.rb', line 521 infect_an_assertion :refute_operator, :wont_be, :reverse |
#refute_respond_to ⇒ Object
See MiniTest::Assertions#refute_respond_to
obj.wont_respond_to msg
:method: wont_respond_to
530 |
# File 'lib/minitest/spec.rb', line 530 infect_an_assertion :refute_respond_to, :wont_respond_to, :reverse |
#refute_same ⇒ Object
See MiniTest::Assertions#refute_same
a.wont_be_same_as b
:method: wont_be_same_as
539 |
# File 'lib/minitest/spec.rb', line 539 infect_an_assertion :refute_same, :wont_be_same_as |