Module: Minitest::Substitute::Substitute
- Defined in:
- lib/minitest/substitute/substitute.rb
Instance Method Summary collapse
-
#substitute(variable, substitute, on: self) { ... } ⇒ Object
Substitute the variable value for the duration of the given block.
Instance Method Details
#substitute(variable, substitute, on: self) { ... } ⇒ Object
Substitute the variable value for the duration of the given block
14 15 16 17 18 19 20 |
# File 'lib/minitest/substitute/substitute.rb', line 14 def substitute(variable, substitute, on: self) substitutor = Minitest::Substitute::Substitutor.new(variable, on: on).substitute(substitute) substitutor.commit yield.tap do substitutor.rollback end end |