shard-spectator/spec/issues/github_issue_29_spec.cr
2022-07-12 23:02:20 -06:00

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