News for hackers. Stuff that matters.
Re:The Tragedy of Given-When-Then by dmitryminkovsky on Tuesday April 16, 2019 @02:19PM (#19675975)
This is why I like Spock [0]. You can go G/W/T/, W/T, T, or Expect [1]. It's billed as "multi-paradigm" which really just means you can do whatever feels right for a given case. Also its data table feature is wonderful [2][3].

[0]: http://spockframework.org/

[1]: http://spockframework.org/spock/docs/1.3/spock_primer.html#_...

[2]: http://spockframework.org/spock/docs/1.3/data_driven_testing...

[3]: https://twitter.com/dminkovsky/status/1116727735399976966

Re:The Tragedy of Given-When-Then by vorg on Tuesday April 16, 2019 @04:28PM (#19677019)
> you can do whatever feels right for a given case

Too bad you can't use whatever specification language feels right. Spock only provides Apache Groovy, with its tacky syntax hacks like long strings for function names, block labels having special meanings based on their name, or the OR and LOR operators being used for drawing tables in the code. In the past when software has provided Groovy for writing specs, they eventually provide an alternative when Groovy's shortfalls become obvious, e.g. Kotlin for Gradle [1], or the Declarative Pipeline Syntax [2] for Jenkins.

[1]: https://docs.gradle.org/5.0/userguide/kotlin_dsl.html

[2]: https://jenkins.io/blog/2016/12/19/declarative-pipeline-beta

Re:The Tragedy of Given-When-Then by zmmmmm on Tuesday April 16, 2019 @08:44PM (#19678662)
> Groovy, with its tacky syntax hacks like long strings for function names

Actually, Kotlin does that too. I think it is even encouraged for writing tests.

Re:The Tragedy of Given-When-Then by dmitryminkovsky on Tuesday April 16, 2019 @08:06PM (#19678484)
Interesting, thank you. Not sure why the string function names, named blocks etc are bad. I enjoy them. Looking forward to reading about this Kotlin DSL though... I like Groovy for testing (your tests are more likely to compile even if they're broken) but it could be better.