mirror of
https://gitea.invidious.io/iv-org/shard-spectator.git
synced 2024-08-15 00:53:35 +00:00
Test class method usage
This commit is contained in:
parent
766b6b17c7
commit
7210b8e11c
1 changed files with 20 additions and 0 deletions
|
@ -17,4 +17,24 @@ Spectator.describe "GitHub Issue #29" do
|
||||||
subject.goodbye
|
subject.goodbye
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
describe "class method" do
|
||||||
|
class Foo
|
||||||
|
def self.test
|
||||||
|
exit 0
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
mock Foo do
|
||||||
|
stub self.exit(code)
|
||||||
|
end
|
||||||
|
|
||||||
|
subject { Foo }
|
||||||
|
|
||||||
|
it "must capture exit" do
|
||||||
|
expect(subject).to receive(:exit).with(0)
|
||||||
|
|
||||||
|
subject.test
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue