title: Mock multiple calls to the same method in spock
body: <p>I am currently writing unit testcase for a groovy application</p>
  <pre><code>class StorePage{
     ..
     ..
     str1 = obj.getDateBasedOnValue(&quot;A&quot;);
     str2 = obj.getDateBasedOnValue(&quot;B&quot;);
  }
  </code></pre>
  <p>Test class</p>
  <pre><code>classStorePageSpec extends Specification{
     Obj obj = Mock(Obj)
     ...
     def &quot;testCase 1&quot;(){
        obj.getDateBasedOnValue(_) &gt;&gt; &quot;some date string 1&quot;
        obj.getDateBasedOnValue(_) &gt;&gt; &quot;some date string 2&quot;
     }
  }
  </code></pre>
  <p>Can someone tell me if this is the right way to mock both the calls in spock? If no then please guide me towards the right solution.</p>