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

  • 關於本站
  • 免責聲明