Module: Kernel
- Defined in:
- lib/override_kernel/exit.rb
Overview
Monkey patch Kernel functions for testing.
Instance Method Summary collapse
- #exit(status = true) ⇒ Object
-
#old_exit ⇒ Object
Patch exit so that it sets a flag rather than ends the application.
Instance Method Details
#exit(status = true) ⇒ Object
40 41 42 43 44 |
# File 'lib/override_kernel/exit.rb', line 40 def exit(status = true) OverrideKernel::AppState.state = :dead old_exit(status) unless OverrideKernel.override_exit return status end |
#old_exit ⇒ Object
Patch exit so that it sets a flag rather than ends the application. (A call to exit will cause testing to stop otherwise).
39 |
# File 'lib/override_kernel/exit.rb', line 39 alias :old_exit :exit |