Open manueljordan opened 8 years ago
Try using a # instead of a $ when trying to evaluate variable names in a feature name or spock block description.
Example: given: "The URL being used is: #url"
I learned this from the bottom of this manual page: https://spockframework.github.io/spock/docs/1.0/data_driven_testing.html#_footnoteref_3
Hi
That only works when the variable has been defined in the where
block
Hello Spock Team
I am working with:
and I have the following code:
Two observations:
One: observe
given: "The URL being used is: /personas/xml/personas"
where the URL/URI value has been added manually.Two: the
url
variable has been defined how an instance variable, because it is common in many test methods. Thereforedef String url
My question is:
how I can display the
url
variable in a Spock's label/block? how (given, then…)? It to be printed through Spock Reports and improve my testing documentationI have read the following: Spocklight: Extra Data Variables for Unroll Description
It working around @Unroll. But I did realize all work around the
where
label/block.I already have tried something like:
And does not work
I want to work around with a syntax similar like the following:
So what could be the correct configuration?
Asume I do a refactor for
PersonaUrlHelper.FINDALL
used in some Spring's@RequestMapping
and in this test method. I don't want update manually the text in thegiven
label/blockSo what is the correct syntax?
If there is no a correct syntax, can be consider this how a new feature?
Thanks in advance