kotest-intellij-plugin
kotest-intellij-plugin copied to clipboard
Adding Live Templates
When a user wants to define a new spec, they can:
- Create a Kotlin file (Not class) in the desired location, with the name of the spec they want to define.
- In the opened file, use one of the provided live templates. For instance
fspecto start defining a FunSpec
fspec expands into:
class MyTest : FunSpec({
test("Foo") {
1 shouldBe 1
}
}
Where MyTest is based on the name of the file, and is the first focused location which lets the user change the Spec name if desired. Pressing tab moves the focus to the name of the test (Foo). The user can change the name then press tab again to focus the test body.
IntelliJ also added an import for FunSpec automatically.
Desired feedback:
What spec styles and abbreviations should we use?
So far I have added:
sspec-> StringSpec- Perhaps FreeSpec is a better spec to focus on, given that it supports nesting. But I think we might harmonize them and settle on a final name for this style
bspec-> BehaviorSpecfspec-> FunSpec- This one clashes a bit with FreeSpec and FeatureSpec
Maybe we can dogfood this one in the wild.. not a lot of users would find the feature w/o us advertising it somewhere.
could also just have stringspec, saving 5 chars isn't a huge deal
Do we want to merge this in @Kantis ?