Skip to content

Instantly share code, notes, and snippets.

@SRGOM
Created August 28, 2015 13:47
Show Gist options
  • Save SRGOM/c10d65f05f44a393d701 to your computer and use it in GitHub Desktop.
Save SRGOM/c10d65f05f44a393d701 to your computer and use it in GitHub Desktop.
"xyz" should "abc" in {
val delayTime = 20
setTimeout( () => delayer.execute( (2, new Date ) ), delayTime )
//Mark the test as complete
val testCompletePromise = Promise[ Boolean ]()
setTimeout( () => {
testCompletePromise.success( true )
} , delayTime * 4 )
println( Console.GREEN + "During run: " + new Date )
testCompletePromise.future map{
_x => {
assert( executionList.size == 3 )
assert( executionList.map( _.callId ).sum == 6 )
assert( executionList.map( e => if( e.executionTime - e.callTime > delayTime ) 1 else 0 ).sum == 3 )
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment