Closed tonypiazza closed 6 years ago
I think the MockTextTerminal is what you need. It just stores the output in a string buffer, without actually printing anything. It also lets you provide preconfigured values for the input in order to test read operations. I use the MockTextTerminal to write Spock tests for text-io (see, for example, TextIoSpec.groovy and TextIoReadSpec.groovy).
It would be useful for testing purposes to have a terminal type that just throws away all output. Similar to /dev/null in Unix/Linux world.
Thanks,
-Tony