Skip to content

Commit

Permalink
Add names to previously anonymous getter and setter test functions
Browse files Browse the repository at this point in the history
  • Loading branch information
lucasfcosta committed Mar 11, 2017
1 parent e852f4f commit eb7f90f
Showing 1 changed file with 14 additions and 14 deletions.
28 changes: 14 additions & 14 deletions test/stub-test.js
Expand Up @@ -2288,7 +2288,7 @@ describe("stub", function () {
prop: "foo"
};

createStub(myObj, "prop").get(function () {
createStub(myObj, "prop").get(function getterFn() {
return "bar";
});

Expand All @@ -2302,7 +2302,7 @@ describe("stub", function () {
}
};

createStub(myObj, "prop").get(function () {
createStub(myObj, "prop").get(function getterFn() {
return "bar";
});

Expand All @@ -2316,7 +2316,7 @@ describe("stub", function () {
}
};

createStub(myObj, "prop").get(function () {
createStub(myObj, "prop").get(function getterFn() {
return "bar";
});

Expand All @@ -2326,15 +2326,15 @@ describe("stub", function () {
it("can set getters for non-existing properties", function () {
var myObj = {};

createStub(myObj, "prop").get(function () {
createStub(myObj, "prop").get(function getterFn() {
return "bar";
});

assert.equals(myObj.prop, "bar");
});

it("can restore stubbed setters for functions", function () {
var propFn = function () {
var propFn = function propFn() {
return "bar";
};

Expand All @@ -2344,7 +2344,7 @@ describe("stub", function () {

var stub = createStub(myObj, "prop");

stub.get(function () {
stub.get(function getterFn() {
return "baz";
});

Expand All @@ -2362,7 +2362,7 @@ describe("stub", function () {

var stub = createStub(myObj, "prop");

stub.get(function () {
stub.get(function getterFn() {
return "baz";
});

Expand All @@ -2378,7 +2378,7 @@ describe("stub", function () {
prop: "foo"
};

createStub(myObj, "prop").set(function () {
createStub(myObj, "prop").set(function setterFn() {
myObj.example = "bar";
});

Expand All @@ -2394,7 +2394,7 @@ describe("stub", function () {
}
};

createStub(myObj, "prop").set(function () {
createStub(myObj, "prop").set(function setterFn() {
myObj.example = "bar";
});

Expand All @@ -2410,7 +2410,7 @@ describe("stub", function () {
}
};

createStub(myObj, "prop").set(function () {
createStub(myObj, "prop").set(function setterFn() {
myObj.example = "bar";
});

Expand All @@ -2422,7 +2422,7 @@ describe("stub", function () {
it("can set setters for non-existing properties", function () {
var myObj = {};

createStub(myObj, "prop").set(function () {
createStub(myObj, "prop").set(function setterFn() {
myObj.example = "bar";
});

Expand All @@ -2432,7 +2432,7 @@ describe("stub", function () {
});

it("can restore stubbed setters for functions", function () {
var propFn = function () {
var propFn = function propFn() {
return "bar";
};

Expand All @@ -2442,7 +2442,7 @@ describe("stub", function () {

var stub = createStub(myObj, "prop");

stub.set(function () {
stub.set(function setterFn() {
myObj.otherProp = "baz";
});

Expand All @@ -2461,7 +2461,7 @@ describe("stub", function () {

var stub = createStub(myObj, "prop");

stub.set(function () {
stub.set(function setterFn() {
myObj.otherProp = "baz";
});

Expand Down

0 comments on commit eb7f90f

Please sign in to comment.