markus1189 / mockito-scala

Syntactic sugar for mockito in Scala
Apache License 2.0
6 stars 0 forks source link

Extend example for `returnMulti` #1

Closed hseeberger closed 7 years ago

hseeberger commented 7 years ago

We should add one more invocation to demonstrate what happens when we invoke more often than the number of given values:

{ // Specifying multiple returns
    val m = mock[Foo]

    m.bar returnsMulti Seq("1", "2", "3")
    m.bar // => "1"
    m.bar // => "2"
    m.bar // => "3"
    m.bar // => "3"
  }

Not sure if "3" is correct, hence my interest in this topic ;-)

markus1189 commented 7 years ago

Agreed, that should be added as an example. It is the way mockito behaves with chained thenReturn so I guess it is "correct" ;)