diff --git a/lib/context.js b/lib/context.js index e7138ba948..84440bef27 100644 --- a/lib/context.js +++ b/lib/context.js @@ -36,6 +36,7 @@ Context.prototype.runnable = function(runnable){ */ Context.prototype.timeout = function(ms){ + if (arguments.length === 0) return this.runnable().timeout(); this.runnable().timeout(ms); return this; }; diff --git a/test/acceptance/context.js b/test/acceptance/context.js index 0d39f14194..add011bdac 100644 --- a/test/acceptance/context.js +++ b/test/acceptance/context.js @@ -65,3 +65,9 @@ describe('Context Siblings', function(){ }) }) + +describe('timeout()', function(){ + it('should return the timeout', function(){ + this.timeout().should.equal(200); + }); +});