shard-spectator/spec/issues/github_issue_29_spec.cr

21 lines
314 B
Crystal
Raw Normal View History

2021-07-05 17:32:45 +00:00
require "../spec_helper"
Spectator.describe "GitHub Issue #29" do
class SomeClass
def goodbye
exit 0
end
end
mock SomeClass do
stub exit(code)
end
describe SomeClass do
it "captures exit" do
expect(subject).to receive(:exit).with(0)
subject.goodbye
end
end
end