Created
          June 23, 2015 09:37 
        
      - 
      
- 
        Save pmlopes/459d4205acf89173dca4 to your computer and use it in GitHub Desktop. 
    Spock and Vertx3
  
        
  
    
      This file contains hidden or 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
    
  
  
    
  | import io.vertx.core.Vertx | |
| import spock.lang.Shared | |
| import spock.lang.Specification | |
| import spock.util.concurrent.BlockingVariable | |
| class HelloSpockSpec extends Specification { | |
| @Shared | |
| def Vertx vertx = Vertx.vertx() | |
| def "test async vert.x"() { | |
| setup: | |
| def result = new BlockingVariable() | |
| when: | |
| vertx.setTimer(1l) { timerId -> | |
| result.set('OK') | |
| } | |
| println "wait 1s" | |
| then: | |
| result.get() == 'OK' | |
| } | |
| } | 
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment