Module: Minitest::Expectations

Included in:
Object
Defined in:
lib/minitest/expectations.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



12
# File 'lib/minitest/expectations.rb', line 12

infect_an_assertion :assert_empty, :must_be_empty, :unary

#assert_equalObject

See Minitest::Assertions#assert_equal

a.must_equal b

:method: must_equal



21
# File 'lib/minitest/expectations.rb', line 21

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



30
# File 'lib/minitest/expectations.rb', line 30

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



41
# File 'lib/minitest/expectations.rb', line 41

infect_an_assertion :assert_in_epsilon, :must_be_within_epsilon

#assert_includesObject

See Minitest::Assertions#assert_includes

collection.must_include obj

:method: must_include



50
# File 'lib/minitest/expectations.rb', line 50

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



59
# File 'lib/minitest/expectations.rb', line 59

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



68
# File 'lib/minitest/expectations.rb', line 68

infect_an_assertion :assert_kind_of, :must_be_kind_of

#assert_matchObject

See Minitest::Assertions#assert_match

a.must_match b

:method: must_match



77
# File 'lib/minitest/expectations.rb', line 77

infect_an_assertion :assert_match, :must_match

#assert_nilObject

See Minitest::Assertions#assert_nil

obj.must_be_nil

:method: must_be_nil



86
# File 'lib/minitest/expectations.rb', line 86

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



99
# File 'lib/minitest/expectations.rb', line 99

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



108
# File 'lib/minitest/expectations.rb', line 108

infect_an_assertion :assert_output, :must_output

#assert_raisesObject

See Minitest::Assertions#assert_raises

proc { ... }.must_raise exception

:method: must_raise



117
# File 'lib/minitest/expectations.rb', line 117

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



126
# File 'lib/minitest/expectations.rb', line 126

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



135
# File 'lib/minitest/expectations.rb', line 135

infect_an_assertion :assert_same, :must_be_same_as

#assert_silentObject

See Minitest::Assertions#assert_silent

proc { ... }.must_be_silent

:method: must_be_silent



144
# File 'lib/minitest/expectations.rb', line 144

infect_an_assertion :assert_silent, :must_be_silent

#assert_throwsObject

See Minitest::Assertions#assert_throws

proc { ... }.must_throw sym

:method: must_throw



153
# File 'lib/minitest/expectations.rb', line 153

infect_an_assertion :assert_throws, :must_throw

#refute_emptyObject

See Minitest::Assertions#refute_empty

collection.wont_be_empty

:method: wont_be_empty



162
# File 'lib/minitest/expectations.rb', line 162

infect_an_assertion :refute_empty, :wont_be_empty, :unary

#refute_equalObject

See Minitest::Assertions#refute_equal

a.wont_equal b

:method: wont_equal



171
# File 'lib/minitest/expectations.rb', line 171

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



180
# File 'lib/minitest/expectations.rb', line 180

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



191
# File 'lib/minitest/expectations.rb', line 191

infect_an_assertion :refute_in_epsilon, :wont_be_within_epsilon

#refute_includesObject

See Minitest::Assertions#refute_includes

collection.wont_include obj

:method: wont_include



200
# File 'lib/minitest/expectations.rb', line 200

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



209
# File 'lib/minitest/expectations.rb', line 209

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



218
# File 'lib/minitest/expectations.rb', line 218

infect_an_assertion :refute_kind_of, :wont_be_kind_of

#refute_matchObject

See Minitest::Assertions#refute_match

a.wont_match b

:method: wont_match



227
# File 'lib/minitest/expectations.rb', line 227

infect_an_assertion :refute_match, :wont_match

#refute_nilObject

See Minitest::Assertions#refute_nil

obj.wont_be_nil

:method: wont_be_nil



236
# File 'lib/minitest/expectations.rb', line 236

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



249
# File 'lib/minitest/expectations.rb', line 249

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



258
# File 'lib/minitest/expectations.rb', line 258

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



267
# File 'lib/minitest/expectations.rb', line 267

infect_an_assertion :refute_same, :wont_be_same_as