diff --git a/lib/vows/suite.js b/lib/vows/suite.js index 9f95ef4..ac8abbb 100644 --- a/lib/vows/suite.js +++ b/lib/vows/suite.js @@ -130,7 +130,7 @@ this.Suite.prototype = new(function () { // If this context has a topic, store it in `lastTopic`, // if not, use the last topic, passed down by a parent // context. - if (topic) { + if (typeof(topic) !== 'undefined') { lastTopic = topic; } else { old = true; diff --git a/test/vows-test.js b/test/vows-test.js index 6679cfb..a0d1b35 100644 --- a/test/vows-test.js +++ b/test/vows-test.js @@ -132,6 +132,13 @@ vows.describe("Vows").addBatch({ assert.equal(topic, 45); } }, + "A non-function topic with a falsy value": { + topic: 0, + + "should work as expected": function (topic) { + assert.equal(topic, 0); + } + }, "A topic returning a function": { topic: function () { return function () { return 42 };