mirror of
https://gitea.invidious.io/iv-org/shard-spectator.git
synced 2024-08-15 00:53:35 +00:00
Add test case handling NoReturn stub and top-level methods (exit)
Fixes https://github.com/icy-arctic-fox/spectator/issues/29
This commit is contained in:
parent
92dbfc2a8e
commit
f728ab6ad7
2 changed files with 24 additions and 0 deletions
20
spec/issues/github_issue_29_spec.cr
Normal file
20
spec/issues/github_issue_29_spec.cr
Normal file
|
@ -0,0 +1,20 @@
|
|||
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
|
Loading…
Add table
Add a link
Reference in a new issue