Created
July 15, 2010 11:45
-
-
Save bmavity/476848 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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