Spock Framework is one of my favorite tools in the Groovy ecosystem toolbox. It makes writing automated tests a few times more pleasant thanks to its opinionated syntax. From time to time I see some corner cases where Spock behaves unexpectedly. Today I would like to show you one of these corner cases and explains what happens under the hood.
Recently I have answered a few questions on Stack Overflow related to Groovy scripts and how they work in combination with closures and delegated objects. Some of use cases may not be intuitive and today I’m gonna show you one of them and explain what happens under the hood.
This blog post is inspired by one of my recent Stack Overflow answers to following question: Grails: why is the Config.groovy file executed during compilation?. Here I’m going to show you step by step what makes
grails package command executing
Config.groovy script and how I’ve managed to find the answer to that question.