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
271 |
# File 'lib/minitest/spec.rb', line 271 infect_an_assertion :assert_empty, :must_be_empty, :unary |
#assert_equal ⇒ Object
See MiniTest::Assertions#assert_equal
a.must_equal b
:method: must_equal
280 |
# File 'lib/minitest/spec.rb', line 280 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
289 |
# File 'lib/minitest/spec.rb', line 289 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
300 |
# File 'lib/minitest/spec.rb', line 300 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
309 |
# File 'lib/minitest/spec.rb', line 309 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
318 |
# File 'lib/minitest/spec.rb', line 318 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
327 |
# File 'lib/minitest/spec.rb', line 327 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
336 |
# File 'lib/minitest/spec.rb', line 336 infect_an_assertion :assert_match, :must_match |
#assert_nil ⇒ Object
See MiniTest::Assertions#assert_nil
obj.must_be_nil
:method: must_be_nil
345 |
# File 'lib/minitest/spec.rb', line 345 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
358 |
# File 'lib/minitest/spec.rb', line 358 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
367 |
# File 'lib/minitest/spec.rb', line 367 infect_an_assertion :assert_output, :must_output |
#assert_raises ⇒ Object
See MiniTest::Assertions#assert_raises
proc { ... }.must_raise exception
:method: must_raise
376 |
# File 'lib/minitest/spec.rb', line 376 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
385 |
# File 'lib/minitest/spec.rb', line 385 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
394 |
# File 'lib/minitest/spec.rb', line 394 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
404 |
# File 'lib/minitest/spec.rb', line 404 infect_an_assertion :assert_send, :must_send |
#assert_silent ⇒ Object
See MiniTest::Assertions#assert_silent
proc { ... }.must_be_silent
:method: must_be_silent
413 |
# File 'lib/minitest/spec.rb', line 413 infect_an_assertion :assert_silent, :must_be_silent |
#assert_throws ⇒ Object
See MiniTest::Assertions#assert_throws
proc { ... }.must_throw sym
:method: must_throw
422 |
# File 'lib/minitest/spec.rb', line 422 infect_an_assertion :assert_throws, :must_throw |
#refute_empty ⇒ Object
See MiniTest::Assertions#refute_empty
collection.wont_be_empty
:method: wont_be_empty
431 |
# File 'lib/minitest/spec.rb', line 431 infect_an_assertion :refute_empty, :wont_be_empty, :unary |
#refute_equal ⇒ Object
See MiniTest::Assertions#refute_equal
a.wont_equal b
:method: wont_equal
440 |
# File 'lib/minitest/spec.rb', line 440 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
449 |
# File 'lib/minitest/spec.rb', line 449 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
460 |
# File 'lib/minitest/spec.rb', line 460 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
469 |
# File 'lib/minitest/spec.rb', line 469 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
478 |
# File 'lib/minitest/spec.rb', line 478 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
487 |
# File 'lib/minitest/spec.rb', line 487 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
496 |
# File 'lib/minitest/spec.rb', line 496 infect_an_assertion :refute_match, :wont_match |
#refute_nil ⇒ Object
See MiniTest::Assertions#refute_nil
obj.wont_be_nil
:method: wont_be_nil
505 |
# File 'lib/minitest/spec.rb', line 505 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
518 |
# File 'lib/minitest/spec.rb', line 518 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
527 |
# File 'lib/minitest/spec.rb', line 527 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
536 |
# File 'lib/minitest/spec.rb', line 536 infect_an_assertion :refute_same, :wont_be_same_as |