Module: Minitest::Spec::DSL::InstanceMethods
Relationships & Source Files | |
Defined in: | lib/minitest/spec.rb |
Overview
Rdoc… why are you so dumb?
Instance Method Summary
-
#_(value = nil, &block)
(also: #value, #expect)
Returns a value monad that has all of
::Minitest::Expectations
methods available to it. -
#expect(value = nil, &block)
Alias for #_.
-
#value(value = nil, &block)
Alias for #_.
- #before_setup Internal use only
Instance Method Details
#_(value = nil, &block) Also known as: #value, #expect
Returns a value monad that has all of ::Minitest::Expectations
methods available to it.
Also aliased to #value and #expect for your aesthetic pleasure:
_(1 + 1).must_equal 2
value(1 + 1).must_equal 2
expect(1 + 1).must_equal 2
This method of expectation-based testing is preferable to straight-expectation methods (on ::Object
) because it stores its test context, bypassing our hacky use of thread-local variables.
At some point, the methods on ::Object
will be deprecated and then removed.
#before_setup
This method is for internal use only.
[ GitHub ]
# File 'lib/minitest/spec.rb', line 311
def before_setup # :nodoc: super Thread.current[:current_spec] = self end
#expect(value = nil, &block)
Alias for #_.
# File 'lib/minitest/spec.rb', line 309
alias expect _
#value(value = nil, &block)
Alias for #_.
# File 'lib/minitest/spec.rb', line 308
alias value _