module MiniTest::Expectations

It's where you hide your “assertions”.

Public Instance Methods

must_be() click to toggle source

See MiniTest::Assertions#assert_operator

n.must_be :<=, 42

This can also do predicates:

str.must_be :empty?
# File lib/minitest/spec.rb, line 357
infect_an_assertion :assert_operator, :must_be, :reverse
must_be_close_to() click to toggle source

See MiniTest::Assertions#assert_in_delta

n.must_be_close_to m [, delta]
# File lib/minitest/spec.rb, line 288
infect_an_assertion :assert_in_delta, :must_be_close_to
Also aliased as: must_be_within_delta
must_be_empty() click to toggle source

See MiniTest::Assertions#assert_empty.

collection.must_be_empty
# File lib/minitest/spec.rb, line 270
infect_an_assertion :assert_empty, :must_be_empty, :unary
must_be_instance_of() click to toggle source

See MiniTest::Assertions#assert_instance_of

obj.must_be_instance_of klass
# File lib/minitest/spec.rb, line 317
infect_an_assertion :assert_instance_of, :must_be_instance_of
must_be_kind_of() click to toggle source

See MiniTest::Assertions#assert_kind_of

obj.must_be_kind_of mod
# File lib/minitest/spec.rb, line 326
infect_an_assertion :assert_kind_of, :must_be_kind_of
must_be_nil() click to toggle source

See MiniTest::Assertions#assert_nil

obj.must_be_nil
# File lib/minitest/spec.rb, line 344
infect_an_assertion :assert_nil, :must_be_nil, :unary
must_be_same_as() click to toggle source

See MiniTest::Assertions#assert_same

a.must_be_same_as b
# File lib/minitest/spec.rb, line 393
infect_an_assertion :assert_same, :must_be_same_as
must_be_silent() click to toggle source

See MiniTest::Assertions#assert_silent

proc { ... }.must_be_silent
# File lib/minitest/spec.rb, line 412
infect_an_assertion :assert_silent, :must_be_silent
must_be_within_delta()
Alias for: must_be_close_to
must_be_within_epsilon() click to toggle source

See MiniTest::Assertions#assert_in_epsilon

n.must_be_within_epsilon m [, epsilon]
# File lib/minitest/spec.rb, line 299
infect_an_assertion :assert_in_epsilon, :must_be_within_epsilon
must_equal() click to toggle source

See MiniTest::Assertions#assert_equal

a.must_equal b
# File lib/minitest/spec.rb, line 279
infect_an_assertion :assert_equal, :must_equal
must_include() click to toggle source

See MiniTest::Assertions#assert_includes

collection.must_include obj
# File lib/minitest/spec.rb, line 308
infect_an_assertion :assert_includes, :must_include, :reverse
must_match() click to toggle source

See MiniTest::Assertions#assert_match

a.must_match b
# File lib/minitest/spec.rb, line 335
infect_an_assertion :assert_match, :must_match
must_output() click to toggle source

See MiniTest::Assertions#assert_output

proc { ... }.must_output out_or_nil [, err]
# File lib/minitest/spec.rb, line 366
infect_an_assertion :assert_output, :must_output
must_raise() click to toggle source

See MiniTest::Assertions#assert_raises

proc { ... }.must_raise exception
# File lib/minitest/spec.rb, line 375
infect_an_assertion :assert_raises, :must_raise
must_respond_to() click to toggle source

See MiniTest::Assertions#assert_respond_to

obj.must_respond_to msg
# File lib/minitest/spec.rb, line 384
infect_an_assertion :assert_respond_to, :must_respond_to, :reverse
must_send() click to toggle source

See MiniTest::Assertions#assert_send TODO: remove me

a.must_send
# File lib/minitest/spec.rb, line 403
infect_an_assertion :assert_send, :must_send
must_throw() click to toggle source

See MiniTest::Assertions#assert_throws

proc { ... }.must_throw sym
# File lib/minitest/spec.rb, line 421
infect_an_assertion :assert_throws, :must_throw
wont_be() click to toggle source

See MiniTest::Assertions#refute_operator

n.wont_be :<=, 42

This can also do predicates:

str.wont_be :empty?
# File lib/minitest/spec.rb, line 517
infect_an_assertion :refute_operator, :wont_be, :reverse
wont_be_close_to() click to toggle source

See MiniTest::Assertions#refute_in_delta

n.wont_be_close_to m [, delta]
# File lib/minitest/spec.rb, line 448
infect_an_assertion :refute_in_delta, :wont_be_close_to
Also aliased as: wont_be_within_delta
wont_be_empty() click to toggle source

See MiniTest::Assertions#refute_empty

collection.wont_be_empty
# File lib/minitest/spec.rb, line 430
infect_an_assertion :refute_empty, :wont_be_empty, :unary
wont_be_instance_of() click to toggle source

See MiniTest::Assertions#refute_instance_of

obj.wont_be_instance_of klass
# File lib/minitest/spec.rb, line 477
infect_an_assertion :refute_instance_of, :wont_be_instance_of
wont_be_kind_of() click to toggle source

See MiniTest::Assertions#refute_kind_of

obj.wont_be_kind_of mod
# File lib/minitest/spec.rb, line 486
infect_an_assertion :refute_kind_of, :wont_be_kind_of
wont_be_nil() click to toggle source

See MiniTest::Assertions#refute_nil

obj.wont_be_nil
# File lib/minitest/spec.rb, line 504
infect_an_assertion :refute_nil, :wont_be_nil, :unary
wont_be_same_as() click to toggle source

See MiniTest::Assertions#refute_same

a.wont_be_same_as b
# File lib/minitest/spec.rb, line 535
infect_an_assertion :refute_same, :wont_be_same_as
wont_be_within_delta()
Alias for: wont_be_close_to
wont_be_within_epsilon() click to toggle source

See MiniTest::Assertions#refute_in_epsilon

n.wont_be_within_epsilon m [, epsilon]
# File lib/minitest/spec.rb, line 459
infect_an_assertion :refute_in_epsilon, :wont_be_within_epsilon
wont_equal() click to toggle source

See MiniTest::Assertions#refute_equal

a.wont_equal b
# File lib/minitest/spec.rb, line 439
infect_an_assertion :refute_equal, :wont_equal
wont_include() click to toggle source

See MiniTest::Assertions#refute_includes

collection.wont_include obj
# File lib/minitest/spec.rb, line 468
infect_an_assertion :refute_includes, :wont_include, :reverse
wont_match() click to toggle source

See MiniTest::Assertions#refute_match

a.wont_match b
# File lib/minitest/spec.rb, line 495
infect_an_assertion :refute_match, :wont_match
wont_respond_to() click to toggle source

See MiniTest::Assertions#refute_respond_to

obj.wont_respond_to msg
# File lib/minitest/spec.rb, line 526
infect_an_assertion :refute_respond_to, :wont_respond_to, :reverse