Forgus / spock

Automatically exported from code.google.com/p/spock
0 stars 0 forks source link

Interactions: unusable junit report in case methods where specified via variables #257

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem? If possible, provide source code and
stack trace.

Assuming the following interactions is specified:

   List methods = ['method_a', 'method_b', 'method_c']

   then:
   for(String method in methods)
     1 * someMock."${method}"(_)

The junit report would look like:

   junit.framework.AssertionFailedError: Too few invocations for:

   1 * someMock."${method}"(_) (0 invocations)
   1 * someMock."${method}"(_) (0 invocations)
   1 * someMock."${method}"(_) (0 invocations)

But I would expect that the report looks like:

   junit.framework.AssertionFailedError: Too few invocations for:

   1 * someMock.method_a(_) (0 invocations)
   1 * someMock.method_b(_) (0 invocations)
   1 * someMock.method_c(_) (0 invocations)

What version of Spock and Groovy are you using?
Spock version: 0.6
Groovy version: 1.7

Please provide any additional information below. You can also assign
labels.

See also discussion in forum 
https://groups.google.com/forum/#!topic/spockframework/tC4nLfFv8cY 

Original issue reported on code.google.com by markus_k...@gmx.de on 19 Jun 2012 at 11:39