ssacher-tgm / mockito

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

Better error reporting for verifyNoMoreInteractions #171

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
I had a subtle error recently where a mock was being reused across tests.
(It turns out ScalaTest doesn't create a new instance per it(..) block. Ouch.)

We spent some time chasing our tails until someone spotted it. I think we'd
have got there much faster if Mockito had told us which methods were
unaccounted for (i.e. not explicitly verify()ed) in the error message for
verifyNoMoreInteractions. Something like:

    The following interactions are not accounted for:
    - boil()
    - pourInto(teaCup)

Or even list all the interactions on the mock and identify which ones
weren't accounted for:

    Interactions marked with * are not accounted for:
    1.   fillWith(filteredWater)
    2. * boil()
    3.   pourInto(sink)
    4. * pourInto(teaCup)
    5.   empty()

Original issue reported on code.google.com by szcze...@gmail.com on 22 Feb 2010 at 7:45

GoogleCodeExporter commented 8 years ago

Original comment by szcze...@gmail.com on 14 Mar 2010 at 9:23

GoogleCodeExporter commented 8 years ago
Fixed in trunk

Original comment by szcze...@gmail.com on 24 May 2010 at 7:55

GoogleCodeExporter commented 8 years ago

Original comment by szcze...@gmail.com on 24 May 2010 at 7:58