shard-spectator/spec/issues/github_issue_29_spec.cr

30 lines
499 B
Crystal
Raw Normal View History

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
2021-07-11 05:04:02 +00:00
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)
2021-07-11 05:04:02 +00:00
end
end
end