March 2016
Intermediate to advanced
304 pages
8h 9m
English
At the lowest level, a Spock test method is highly characterized by its individual blocks. This term is used for the code labels inside a test method. You’ve already seen the given-when-then blocks multiple times in the previous chapters, as shown in the following listing.

Apart from the given-when-then blocks, Spock offers several other blocks that express different test semantics. The full list is shown in table 4.1.
|
Spock block |
Description |
Expected usage |
|---|---|---|
| given: | Creates initial conditions | 85% |
| setup: ... |
Read now
Unlock full access