thanneeruvenu / spock

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

Expect / Where error message #251

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Hello 
I have got an error:

cacheSites.size() == checkSites.size()
|          |      |  |          |
|          2      |  |          1
|                 |  [[id:1, name:yandex, displayName:Yandex.ru, 
logo:yandex.png, embedCode:http://mail.ru/emb]]
|                 false
[1:[logo:yandex.png, name:yandex, displayName:Yandex.ru, 
embedCode:http://mail.ru/emb], 5:[logo:null, name:lenta.ru, displayName:Lenta 
News, embedCode:null]]
 <Click to see difference>

    at com.videosearch.SitesCacheSpec.checkSameSites(SitesCacheSpec.groovy:68)
    at org.spockframework.util.GroovyRuntimeUtil.invokeMethod(GroovyRuntimeUtil.java:100)
    at com.videosearch.SitesCacheSpec.check active sites by platform(SitesCacheSpec.groovy:53)

Really cool description! But how can I know which "where data object" rises and 
error? I have got 2 where variables (platform, activeSites) for this test. It 
will be really cool if spock will display:

Condition not satisfied:
 ...

when variables was:
  platform == "android"
  activeSites == [...]

Original issue reported on code.google.com by belov...@gmail.com on 10 May 2012 at 1:59

GoogleCodeExporter commented 8 years ago
Use @Unroll together with a naming pattern. For example:

@Unroll
def "do sth. with #platform and #activeSites"() { ... }

Alternatively, the annotation can also go on the class.

Original comment by pnied...@gmail.com on 10 May 2012 at 2:02

GoogleCodeExporter commented 8 years ago
thanks

Original comment by belov...@gmail.com on 12 May 2012 at 10:19

GoogleCodeExporter commented 8 years ago

Original comment by pnied...@gmail.com on 12 May 2012 at 11:10