mirror of
https://gitea.invidious.io/iv-org/shard-spectator.git
synced 2024-08-15 00:53:35 +00:00
Clear stubs defined with expect().to receive()
syntax after test finishes
This commit is contained in:
parent
25b9931002
commit
5c910e5a85
3 changed files with 25 additions and 6 deletions
|
@ -146,9 +146,9 @@ Spectator.describe "Mocks Docs" do
|
|||
inst.something
|
||||
end
|
||||
|
||||
it "leaks stubs to other examples" do
|
||||
it "reverts to default stub for other examples" do
|
||||
inst = mock(MyStruct)
|
||||
expect(inst.something).to eq(7) # Previous stub was leaked.
|
||||
expect(inst.something).to eq(5) # Default stub used instead of original behavior.
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue