Skip to content

Instantly share code, notes, and snippets.

@bmavity
Created July 15, 2010 11:45
Show Gist options
  • Save bmavity/476848 to your computer and use it in GitHub Desktop.
Save bmavity/476848 to your computer and use it in GitHub Desktop.
context('a context tester', function() {
var result;
this.when('when async', function() {
var self = this;
sys.puts('starting async');
setTimeout(function() {
sys.puts('2 seconds later');
result = 2;
self.done();
}, 2000);
});
this.observation('should not finish execution until all observations of async when are complete', function() {
this.observe(result).should['equal'](2);
});
this.observation('should ')
});
context('a second context tester', function() {
var obj = {
doIt: function() {
sys.puts('doing it');
return 8;
}
},
result;
this.when('when sync', function() {
result = obj.doIt();
this.done();
});
this.observation('should not finish execution until all observations of sync when are complete', function() {
this.observe(result).should['equal'](8);
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment