mirror of
https://gitea.invidious.io/iv-org/shard-spectator.git
synced 2024-08-15 00:53:35 +00:00
Intercept most exit calls and raise instead
This commit is contained in:
parent
3c9c7f88be
commit
754bfd6939
4 changed files with 43 additions and 15 deletions
13
spec/spectator/system_exit_spec.cr
Normal file
13
spec/spectator/system_exit_spec.cr
Normal file
|
@ -0,0 +1,13 @@
|
|||
require "../spec_helper"
|
||||
|
||||
Spectator.describe Spectator::SystemExit do
|
||||
it "is raised when an attempt is made to exit the application" do
|
||||
expect { exit }.to raise_error(described_class)
|
||||
end
|
||||
|
||||
it "has the status code passed to an exit call" do
|
||||
exit 5
|
||||
rescue error : Spectator::SystemExit
|
||||
expect(error.status).to eq(5)
|
||||
end
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue