From 2eec65d4b006bbb47d720f212dc49c8e931d6bcd Mon Sep 17 00:00:00 2001 From: John Reeves Date: Sat, 27 Apr 2013 10:06:17 +0100 Subject: [PATCH 1/2] Added sinon.restore() docs. --- docs/index.html | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/docs/index.html b/docs/index.html index 3fc9adc..6e3d109 100644 --- a/docs/index.html +++ b/docs/index.html @@ -452,8 +452,9 @@

Stub API

Replaces object.method with a stub function. The original function can be restored by calling object.method.restore(); - (or stub.restore();). An exception is thrown if the property - is not already a function, to help avoid typos when stubbing methods. + (or stub.restore(); and sinon.restore(stub);). + An exception is thrown if the property is not already a function, to + help avoid typos when stubbing methods.
var stub = sinon.stub(object, "method", func);
@@ -471,7 +472,8 @@

Stub API

If you want to create a stub object of MyConstructor, but don't want the constructor to be invoked, use this utility function: -
var stub = sinon.createStubInstance(MyConstructor)
+
var stub = sinon.createStubInstance(MyConstructor)

+ Stubbed objects can be restored by sinon.restore(obj);
stub.withArgs(arg1[, arg2, ...]);
@@ -1611,6 +1613,11 @@

Sinon.JS utilities

stubs all implemented functions. The given constructor function is not invoked. See also the stub API.
+
sinon.restore(obj)
+
+ Restores the supplied stub, spy, or restoable methods of a stubbed + object. +
sinon.format(object)
Formats an object for pretty printing in error messages. Sinon < 1.3.0 From 56ce572f79071beb3625b820e06685cbfe14f651 Mon Sep 17 00:00:00 2001 From: John Reeves Date: Mon, 29 Apr 2013 08:32:25 +0200 Subject: [PATCH 2/2] Typo. restoable => restorable --- docs/index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/index.html b/docs/index.html index 6e3d109..fa476da 100644 --- a/docs/index.html +++ b/docs/index.html @@ -1615,7 +1615,7 @@

Sinon.JS utilities

sinon.restore(obj)
- Restores the supplied stub, spy, or restoable methods of a stubbed + Restores the supplied stub, spy, or restorable methods of a stubbed object.
sinon.format(object)