Created
March 8, 2012 16:50
-
-
Save antony/2002027 to your computer and use it in GitHub Desktop.
Spock Formatting
This file contains 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
def "The 'recommended' way"() { | |
when: | |
enabled = true | |
firstName = "Luke" | |
lastName = "Daley" | |
createButton.click() | |
then: | |
at ShowPage | |
} | |
def "The 'readable' way"() { | |
when: | |
enabled = true | |
firstName = "Luke" | |
lastName = "Daley" | |
createButton.click() | |
then: | |
at ShowPage | |
} |
Yeah, I get the rationale. I think of the block labels as comments with some magic. Making them look like blocks could be misleading.
We currently use the 'readable' style, but have to admit I now use the 'recommended' way outside of Sky. Not sure if that's just because I don't have to fight IntelliJ
Is it recommended because that is just the default in IntelliJ? O No me gusta.
It's recommended because the examples are shown in that way and the project
founders demonstrate it in that way, and logically, if you consider the
headings as labels, out should be that way...
But...
In terms of readability, and considering it as a DSL, I.should be able to
configure intellij as I prefer
…On Mar 8, 2012 10:19 PM, "Tomas Lin" < ***@***.***> wrote:
Is it recommended because that is just the default in IntelliJ? O No me
gusta.
---
Reply to this email directly or view it on GitHub:
https://gist.github.com/2002027
Nice. Saves me doing it! Thanks @tomaslin
Label indents. In 2011. Crazy people.
Indents ftw @bodiam!
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
P.S. I still think indentation (although I realise switch/case statements which use labels also aren't indented) is more readable. The labels munge into the set-up/assertions otherwise