Skip to content

Commit c9a82f6

Browse files
committed
Fixed tests for ignoring function return value
1 parent 0b8e282 commit c9a82f6

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

test/rename.spec.js

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -150,15 +150,24 @@ describe("gulp-rename", function () {
150150
helper(srcPattern, obj, expectedPath, done);
151151
});
152152

153-
it("can return a whole new object", function (done) {
153+
it("ignores the return value", function (done) {
154154
var obj = function (/*path*/) {
155155
return {
156156
dirname: "elsewhere",
157157
basename: "aloha",
158158
extname: ".md"
159159
};
160160
};
161-
var expectedPath = "test/elsewhere/aloha.md";
161+
var expectedPath = "test/fixtures/hello.txt";
162+
helper(srcPattern, obj, expectedPath, done);
163+
});
164+
165+
it("receives object with extname even if a different value is returned", function (done) {
166+
var obj = function (path) {
167+
path.extname.should.equal(".txt");
168+
return path.extname = ".md";
169+
};
170+
var expectedPath = "test/fixtures/hello.md";
162171
helper(srcPattern, obj, expectedPath, done);
163172
});
164173
});

0 commit comments

Comments
 (0)