Module: Minitest::ShouldJustWork::TestHelpers
- Defined in:
- lib/minitest/should_just_work.rb,
sig/minitest/should_just_work.rbs
Overview
Prepended to Minitest::Test so every test hands itself to ShouldJustWork before it runs, and so tests gain the #msg and #otherwise helpers.
Instance Attribute Summary collapse
-
#msg(string = nil) ⇒ String?
Reads the failure message waiting to be attached to the next comparison, or sets it when given one.
Instance Method Summary collapse
- #before_setup ⇒ void
-
#otherwise(message) ⇒ String?
Reads better than #msg in front of an assertion.
Instance Attribute Details
#msg(string = nil) ⇒ String?
Reads the failure message waiting to be attached to the next comparison, or sets it when given one.
161 162 163 164 |
# File 'lib/minitest/should_just_work.rb', line 161 def msg(string = nil) self.msg = string if string @msg end |
Instance Method Details
#before_setup ⇒ void
This method returns an undefined value.
154 155 156 157 |
# File 'lib/minitest/should_just_work.rb', line 154 def before_setup Should.init self super end |
#otherwise(message) ⇒ String?
Reads better than #msg in front of an assertion.
169 |
# File 'lib/minitest/should_just_work.rb', line 169 def otherwise() = msg() |