Skip to content

Commit

Permalink
Add a failing test for sinonjs#1695
Browse files Browse the repository at this point in the history
  • Loading branch information
mantoni authored and mroderick committed Apr 27, 2018
1 parent 2e7e8ef commit af99126
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions test/sandbox-test.js
Expand Up @@ -463,6 +463,22 @@ describe("Sandbox", function () {
assert.equals(object.property, existing);
});

it("should replace an inherited property", function () {
var replacement = "replacement";
var existing = "existing";
var object = Object.create({
property: existing
});

this.sandbox.replace(object, "property", replacement);

assert.equals(object.property, replacement);

this.sandbox.restore();

assert.equals(object.property, existing);
});

it("should refuse to replace a non-function with a function", function () {
var sandbox = this.sandbox;
var replacement = function () { return "replacement"; };
Expand Down

0 comments on commit af99126

Please sign in to comment.