Extending Spock (into the Future)


                @Stepwise
                class MySpec extends Specification {

                }
                

                class MySpec extends Specification {

                    @AutoCleanup
                    FileReader reader

                    @IgnoreIf({ os.windows })
                    def "only runs on non-windows hosts"(){
                        //...
                    }

                }
                

                class MySpec extends Specification {
                    @Rule
                    TemporaryFolder temporaryFolder
                }
                

                @SpringBootTest
                class MySpec extends Specification {
                }
                

More Information

http://spockframework.org/spock/docs/1.3/extensions.html

            class Spock2 extends Specification {

              def "maximum of two numbers #a, #b = #c" (int a, int b, int c) {
                expect:
                Math.max(a, b) == c

                where:
                a | b | c
                1 | 3 | 3
                7 | 4 | 7
                0 | 0 | 0
              }
            }
            

Questions?

https://github.com/spockframework/spock-gr8conf-2019