Spock supports JUnit rules out of the box. We simply add a rule with the @Rule annotation to our Spock specification and the rule can be used just like in a JUnit test. The Spring Boot project contains a JUnit rule OutputCapture to capture the output of System.out and System.err. In the following example specification we apply the OutputCapture rule and use it in two feature methods: package com.m
![Spocklight: Capture and Assert System Output](https://cdn-ak-scissors.b.st-hatena.com/image/square/863f1bc47a30ed8c86e1e3bed1a69420305b7464/height=288;version=1;width=512/https%3A%2F%2Fwww.mrhaki.com%2Fimages%2Fjdriven-photo.png)