Method: Minitest::Spec::DSL#before
- Defined in:
- lib/minitest/spec.rb
permalink #before(_type = nil, &block) ⇒ Object
Define a ‘before’ action. Inherits the way normal methods should.
NOTE: type
is ignored and is only there to make porting easier.
Equivalent to Minitest::Test#setup.
192 193 194 195 196 197 |
# File 'lib/minitest/spec.rb', line 192 def before _type = nil, &block define_method :setup do super() self.instance_eval(&block) end end |