Mockingbird Documentation 0.18.0

Function reset(_:​)

public func reset(_ mocks: NSObjectProtocol...)  

Remove all recorded invocations and configured stubs.

Fully reset a set of mocks during test runs by removing all recorded invocations and clearing all configurations.

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

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

reset(bird)

print(bird.name)  // Error: Missing stubbed implementation
verify(bird.name).wasCalled()  // Error: Got 0 invocations

Parameters

mocks NSObject​Protocol

A set of mocks to reset.