Skip to content

Commit

Permalink
Fix getting timeout from Context (close #1282)
Browse files Browse the repository at this point in the history
  • Loading branch information
travisjeffery committed Jul 25, 2014
1 parent fcdfadb commit 1048141
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions lib/context.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
};
Expand Down
6 changes: 6 additions & 0 deletions test/acceptance/context.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,3 +65,9 @@ describe('Context Siblings', function(){
})

})

describe('timeout()', function(){
it('should return the timeout', function(){
this.timeout().should.equal(200);
});
});

0 comments on commit 1048141

Please sign in to comment.