-
-
Save antony/2002027 to your computer and use it in GitHub Desktop.
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 | |
} |
an artificially unreadable example; add a blank line before line 7
def "The 'recommended' way"() {
when:
enabled = true
firstName = "Luke"
lastName = "Daley"
createButton.click()
then:
at ShowPage
}
Well, we all know @ldaley can't write nicely formatted code. That doesn't prove anything
How do you 'like' on this damn thing? :)
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
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.
Nice. Saves me doing it! Thanks @tomaslin
Label indents. In 2011. Crazy people.
Indents ftw @bodiam!
Note that #2 (readable) is my suggestion, #1 (recommended) is the official way.