logo
  • 教程列表
  • SO官方文档
  • 开始使用 spock
    • 安装或设置
    • Hello World 使用的时间和时间或期望
  1. StackOverflow 文档
  2. spock 教程
  3. 开始使用 spock
  4. Hello World 使用的时间和时间或期望

Hello World 使用的时间和时间或期望

Created: November-22, 2018

import spock.lang.*

class HelloWorldSpec extends Specification {

    @Shared message = 'Hello world!'

    def "The world can say hello using when and then"() {
        when:
            def newMessage = message
        then:   
            newMessage == 'Hello world!'
    }

    def "The world can say hello using expect"(){
        expect:
            message == 'Hello world!'
    }
}
  • 安装或设置

Copyright © 2018. All right reserved

tastones.com 备案号:鲁ICP备18045372号-1

  • 关于我们
  • 免责声明