Module: MiniTest::Expectations

Included in:
Object
Defined in:
lib/minitest/spec.rb

Overview

It's where you hide your “assertions”.

Instance Method Summary collapse

Instance Method Details

#assert_emptyObject

See MiniTest::Assertions#assert_empty.

collection.must_be_empty

:method: must_be_empty


264
# File 'lib/minitest/spec.rb', line 264

infect_an_assertion :assert_empty, :must_be_empty, :unary

#assert_equalObject

See MiniTest::Assertions#assert_equal

a.must_equal b

:method: must_equal


273
# File 'lib/minitest/spec.rb', line 273

infect_an_assertion :assert_equal, :must_equal

#assert_in_deltaObject

See MiniTest::Assertions#assert_in_delta

n.must_be_close_to m [, delta]

:method: must_be_close_to


282
# File 'lib/minitest/spec.rb', line 282

infect_an_assertion :assert_in_delta, :must_be_close_to

#assert_in_epsilonObject

See MiniTest::Assertions#assert_in_epsilon

n.must_be_within_epsilon m [, epsilon]

:method: must_be_within_epsilon


293
# File 'lib/minitest/spec.rb', line 293

infect_an_assertion :assert_in_epsilon, :must_be_within_epsilon

#assert_includesObject

See MiniTest::Assertions#assert_includes

collection.must_include obj

:method: must_include


302
# File 'lib/minitest/spec.rb', line 302

infect_an_assertion :assert_includes, :must_include, :reverse

#assert_instance_ofObject

See MiniTest::Assertions#assert_instance_of

obj.must_be_instance_of klass

:method: must_be_instance_of


311
# File 'lib/minitest/spec.rb', line 311

infect_an_assertion :assert_instance_of, :must_be_instance_of

#assert_kind_ofObject

See MiniTest::Assertions#assert_kind_of

obj.must_be_kind_of mod

:method: must_be_kind_of


320
# File 'lib/minitest/spec.rb', line 320

infect_an_assertion :assert_kind_of, :must_be_kind_of

#assert_matchObject

See MiniTest::Assertions#assert_match

a.must_match b

:method: must_match


329
# File 'lib/minitest/spec.rb', line 329

infect_an_assertion :assert_match, :must_match

#assert_nilObject

See MiniTest::Assertions#assert_nil

obj.must_be_nil

:method: must_be_nil


338
# File 'lib/minitest/spec.rb', line 338

infect_an_assertion :assert_nil, :must_be_nil, :unary

#assert_operatorObject

See MiniTest::Assertions#assert_operator

n.must_be :<=, 42

This can also do predicates:

str.must_be :empty?

:method: must_be


351
# File 'lib/minitest/spec.rb', line 351

infect_an_assertion :assert_operator, :must_be, :reverse

#assert_outputObject

See MiniTest::Assertions#assert_output

proc { ... }.must_output out_or_nil [, err]

:method: must_output


360
# File 'lib/minitest/spec.rb', line 360

infect_an_assertion :assert_output, :must_output

#assert_raisesObject

See MiniTest::Assertions#assert_raises

proc { ... }.must_raise exception

:method: must_raise


369
# File 'lib/minitest/spec.rb', line 369

infect_an_assertion :assert_raises, :must_raise

#assert_respond_toObject

See MiniTest::Assertions#assert_respond_to

obj.must_respond_to msg

:method: must_respond_to


378
# File 'lib/minitest/spec.rb', line 378

infect_an_assertion :assert_respond_to, :must_respond_to, :reverse

#assert_sameObject

See MiniTest::Assertions#assert_same

a.must_be_same_as b

:method: must_be_same_as


387
# File 'lib/minitest/spec.rb', line 387

infect_an_assertion :assert_same, :must_be_same_as

#assert_sendObject

See MiniTest::Assertions#assert_send TODO: remove me

a.must_send

:method: must_send


397
# File 'lib/minitest/spec.rb', line 397

infect_an_assertion :assert_send, :must_send

#assert_silentObject

See MiniTest::Assertions#assert_silent

proc { ... }.must_be_silent

:method: must_be_silent


406
# File 'lib/minitest/spec.rb', line 406

infect_an_assertion :assert_silent, :must_be_silent

#assert_throwsObject

See MiniTest::Assertions#assert_throws

proc { ... }.must_throw sym

:method: must_throw


415
# File 'lib/minitest/spec.rb', line 415

infect_an_assertion :assert_throws, :must_throw

#refute_emptyObject

See MiniTest::Assertions#refute_empty

collection.wont_be_empty

:method: wont_be_empty


424
# File 'lib/minitest/spec.rb', line 424

infect_an_assertion :refute_empty, :wont_be_empty, :unary

#refute_equalObject

See MiniTest::Assertions#refute_equal

a.wont_equal b

:method: wont_equal


433
# File 'lib/minitest/spec.rb', line 433

infect_an_assertion :refute_equal, :wont_equal

#refute_in_deltaObject

See MiniTest::Assertions#refute_in_delta

n.wont_be_close_to m [, delta]

:method: wont_be_close_to


442
# File 'lib/minitest/spec.rb', line 442

infect_an_assertion :refute_in_delta, :wont_be_close_to

#refute_in_epsilonObject

See MiniTest::Assertions#refute_in_epsilon

n.wont_be_within_epsilon m [, epsilon]

:method: wont_be_within_epsilon


453
# File 'lib/minitest/spec.rb', line 453

infect_an_assertion :refute_in_epsilon, :wont_be_within_epsilon

#refute_includesObject

See MiniTest::Assertions#refute_includes

collection.wont_include obj

:method: wont_include


462
# File 'lib/minitest/spec.rb', line 462

infect_an_assertion :refute_includes, :wont_include, :reverse

#refute_instance_ofObject

See MiniTest::Assertions#refute_instance_of

obj.wont_be_instance_of klass

:method: wont_be_instance_of


471
# File 'lib/minitest/spec.rb', line 471

infect_an_assertion :refute_instance_of, :wont_be_instance_of

#refute_kind_ofObject

See MiniTest::Assertions#refute_kind_of

obj.wont_be_kind_of mod

:method: wont_be_kind_of


480
# File 'lib/minitest/spec.rb', line 480

infect_an_assertion :refute_kind_of, :wont_be_kind_of

#refute_matchObject

See MiniTest::Assertions#refute_match

a.wont_match b

:method: wont_match


489
# File 'lib/minitest/spec.rb', line 489

infect_an_assertion :refute_match, :wont_match

#refute_nilObject

See MiniTest::Assertions#refute_nil

obj.wont_be_nil

:method: wont_be_nil


498
# File 'lib/minitest/spec.rb', line 498

infect_an_assertion :refute_nil, :wont_be_nil, :unary

#refute_operatorObject

See MiniTest::Assertions#refute_operator

n.wont_be :<=, 42

This can also do predicates:

str.wont_be :empty?

:method: wont_be


511
# File 'lib/minitest/spec.rb', line 511

infect_an_assertion :refute_operator, :wont_be, :reverse

#refute_respond_toObject

See MiniTest::Assertions#refute_respond_to

obj.wont_respond_to msg

:method: wont_respond_to


520
# File 'lib/minitest/spec.rb', line 520

infect_an_assertion :refute_respond_to, :wont_respond_to, :reverse

#refute_sameObject

See MiniTest::Assertions#refute_same

a.wont_be_same_as b

:method: wont_be_same_as


529
# File 'lib/minitest/spec.rb', line 529

infect_an_assertion :refute_same, :wont_be_same_as