A.1. Optional Groovy installation

First, let’s get a big misunderstanding out of the way. It’s perfectly possible to use Spock in your Java project without installing Groovy itself. It’s nice to have the Groovy tools available for quick tests and small scripts, but they’re by no means necessary.

To install Groovy, go to http://groovy-lang.org/download.html and follow the instructions for your operating system. The easiest way is to download the zip file, extract it in a directory of your choice, and set your PATH variable accordingly.

After installing Groovy, you should have the following commands available:

  • groovyc—Groovy compiler. Apart from simple tests, you typically don’t use this directly.
  • groovy—Groovy runner. You can use this to run individual Groovy scripts.
  • groovysh—Groovy shell. This is an interactive way to run Groovy statements.
  • groovyconsole—Graphical Groovy console. This is the recommended way to start your Groovy journey because it provides a friendly GUI application you can use to evaluate Groovy statements.
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.141.197.251