Spcokのショートカットキーで補完する設定
これの内容がカッコイイのでメモ。
Getting Started with Spock and Groovy
1.File Templateの設定
2.Spock Specificationを作成を試す
3)以下のコードが生成される
import spock.lang.Specification /** * @author orangeclover */ class MyBasicTest extends Specification { }
OK
次に、Live Templatesという機能らしい。
Ctrl + j dの後にspwgt と打つとSpock Given-When-Thenのテンプレートが補完される。
かっちょええ。
IDE使ってる人には普通なのかもしれないけど(^_^;)
3.Live Templatesの設定
4)spwtの内容
- Abbreviation:spwt
- Description:Spock When-Then
def "$NAME$"() { when: $END$ then: true }
7)同じように、spwgtを追加
- Abbreviation:spwgt
- Description:Spock Given-When-Then
def "$NAME$"() { given: $END$ when: then: true }
8)同じようにspewを追加
- Abbreviation:spew
- Description: Spock Expect-Where
def "$NAME$"() { expect: $END$ where: }