Skip to content

Commit

Permalink
[test] Assert that next() bounds the function to the test
Browse files Browse the repository at this point in the history
  • Loading branch information
customcommander authored and juandopazo committed Feb 27, 2014
1 parent edbc850 commit 7fca7d5
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/test/tests/unit/assets/general-tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,21 @@ YUI.add('general-tests', function(Y) {

self.wait();
},
'test: next() bounds the function to the test': function () {
var self = this;

self.foo = 'bar';

function async(callback) {
setTimeout(callback, 0);
}

async(self.next(function () {
self.assert(this.foo === 'bar');
}));

self.wait();
},
_should: {
error: {
'test: resume without wait': true
Expand Down

0 comments on commit 7fca7d5

Please sign in to comment.