Mockingbird Documentation 0.14.1

Function clear​Stubs(on:​)

public func clearStubs(on mocks: Mock)

Remove all concrete stubs.

Partially reset a set of mocks during test runs by removing all stubs.

let bird = mock(Bird.self)
given(bird.getName()).willReturn("Ryan")

print(bird.name)  // Prints "Ryan"
verify(bird.getName()).wasCalled()  // Passes

clearStubs(on: bird)

print(bird.name)  // Error: Missing stubbed implementation
verify(bird.getName()).wasCalled()  // Passes

Parameters

mocks Mock

A set of mocks to reset.