Skip to content

Commit

Permalink
[New] expose sinon.assert on sandbox instances.
Browse files Browse the repository at this point in the history
Fixes #1075.
  • Loading branch information
ljharb committed Jun 29, 2016
1 parent 8d0f7b6 commit 2f9268f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/sinon/sandbox.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ var extend = require("./extend");
var createInstance = require("./util/core/create");
var sinonCollection = require("./collection");
var sinonMatch = require("./match");
var sinonAssert = require("./assert");

var push = [].push;

Expand Down Expand Up @@ -132,7 +133,9 @@ extend(sinonSandbox, {
return sandbox;
},

match: sinonMatch
match: sinonMatch,

assert: sinonAssert
});

sinonSandbox.useFakeXMLHttpRequest = sinonSandbox.useFakeServer;
Expand Down
6 changes: 6 additions & 0 deletions test/sandbox-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,12 @@ describe("sinon.sandbox", function () {
assert.same(sandbox.match, sinon.match);
});

it("exposes assert", function () {
var sandbox = sinon.sandbox.create();

assert.same(sandbox.assert, sinon.assert);
});

describe(".useFakeTimers", function () {
beforeEach(function () {
this.sandbox = sinon.create(sinon.sandbox);
Expand Down

0 comments on commit 2f9268f

Please sign in to comment.