mirror of
https://gitea.invidious.io/iv-org/shard-spectator.git
synced 2024-08-15 00:53:35 +00:00
Re-enable logger after catching exit
The logger is closed during at-exit hooks that get invoked by Kernel's exit method.
This commit is contained in:
parent
60b5f151f1
commit
e2cdc9e08e
2 changed files with 4 additions and 0 deletions
|
@ -12,6 +12,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|||
### Fixed
|
||||
- Clear stubs defined with `expect().to receive()` syntax after test finishes to prevent leakage between tests.
|
||||
- Ensure stubs defined with `allow().to receive()` syntax are cleared after test finishes when used inside a test (another leakage).
|
||||
- Fix crash caused when logging is enabled after running an example that attempts to exit.
|
||||
|
||||
### Removed
|
||||
- Removed support for stubbing undefined (untyped) methods in lazy doubles. Avoids possible segfault.
|
||||
|
|
|
@ -20,6 +20,9 @@ class Process
|
|||
# Replace the typically used exit method with a method that raises.
|
||||
# This allows tests to catch attempts to exit the application.
|
||||
def self.exit(status = 0) : NoReturn
|
||||
# Re-enable log that is disabled from at-exit handlers.
|
||||
::Log.setup_from_env(default_level: :none)
|
||||
|
||||
raise ::Spectator::SystemExit.new(status: status)
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue