mirror of
https://gitea.invidious.io/iv-org/shard-spectator.git
synced 2024-08-15 00:53:35 +00:00
29 lines
499 B
Crystal
29 lines
499 B
Crystal
require "../spec_helper"
|
|
|
|
Spectator.describe "GitHub Issue #29" do
|
|
class SomeClass
|
|
def goodbye
|
|
exit 0
|
|
end
|
|
end
|
|
|
|
describe SomeClass do
|
|
it "captures exit" do
|
|
expect { subject.goodbye }.to raise_error(Spectator::SystemExit)
|
|
end
|
|
end
|
|
|
|
describe "class method" do
|
|
class Foo
|
|
def self.test
|
|
exit 0
|
|
end
|
|
end
|
|
|
|
subject { Foo }
|
|
|
|
it "must capture exit" do
|
|
expect { subject.test }.to raise_error(Spectator::SystemExit)
|
|
end
|
|
end
|
|
end
|