I have a file with n lines.
In my Spock test, I download, read the file, and assert each line of it.
Is there a way to produce n tests in the report instead of a one?
I have a file with n lines.
In my Spock test, I download, read the file, and assert each line of it.
Is there a way to produce n tests in the report instead of a one?
Copyright © 2021 Jogjafile Inc.
Maybe you know how to
@Unroll
Spock tests and feature method names like this:The result when running the test e.g. in IntelliJ IDEA looks like this:
But you can also use dynamic data providers, not just fixed sets of values. They just need to be
Iterable
.If for example you have a resource file like this
you can use it as a data provider like this:
The result will look like this: