mirror of
https://gitea.invidious.io/iv-org/shard-spectator.git
synced 2024-08-15 00:53:35 +00:00
Intercept most exit calls and raise instead
This commit is contained in:
parent
3c9c7f88be
commit
754bfd6939
4 changed files with 43 additions and 15 deletions
|
@ -7,14 +7,9 @@ Spectator.describe "GitHub Issue #29" do
|
|||
end
|
||||
end
|
||||
|
||||
# mock SomeClass do
|
||||
# inject_stub abstract def exit(code)
|
||||
# end
|
||||
|
||||
describe SomeClass do
|
||||
xit "captures exit", pending: "Mock redesign" do
|
||||
expect(subject).to receive(:exit).with(0)
|
||||
subject.goodbye
|
||||
it "captures exit" do
|
||||
expect { subject.goodbye }.to raise_error(Spectator::SystemExit)
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -25,16 +20,10 @@ Spectator.describe "GitHub Issue #29" do
|
|||
end
|
||||
end
|
||||
|
||||
# mock Foo do
|
||||
# inject_stub abstract def self.exit(code)
|
||||
# end
|
||||
|
||||
subject { Foo }
|
||||
|
||||
xit "must capture exit", pending: "Mock redesign" do
|
||||
expect(subject).to receive(:exit).with(0)
|
||||
|
||||
subject.test
|
||||
it "must capture exit" do
|
||||
expect { subject.test }.to raise_error(Spectator::SystemExit)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue