Skip to content

Should not be able to restore an anonymous (pure) stub #44

@jonathan-benn

Description

@jonathan-benn

For anonymous (pure) stubs, that is to say a stub created via stub = sinon.stub() that is not overriding another function, the Sinon.JS library does not allow you to call the restore() method.

e.g.

stub = sinon.stub()
stub.restore() // throws "TypeError: stub.restore is not a function"

While the exact error message doesn't matter too much, Sinon.PY should probably also throw an error. It doesn't make sense to try to restore a pure stub.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions