title: Unit testing with Spock fails when using use(TimeCategory)
body: <p>I'm using Grails 2.4.4 in my project, and I'm trying to write a unit test case using Spock. The method I'm trying to unit test uses <code>use(TimeCategory)</code>. The test case was running for too long, and on debug I found that it's not moving past the point in code where I had <code>use(TimeCategory)</code>. Please find below the method and the test case I have written for it:</p>
  
  <pre><code>def getEstimatedSl(val) {
  
          // some code
          calculateSl()
          // some code
      }
  
  def calculateSl() {
      use(TimeCategory) {
              interval = 10 
              startDate = //some date value// 
              endDate = //some date value// 
          } 
  
          while (endDate.compareTo(startDate) &gt;= 0) { 
              use(TimeCategory) { 
                  startDate += interval 
              } 
          }
  }
  
  void "test getEstimatedSl success"() {
          when:
          def dto = service.getEstimatedSl('ABCDEFGH')
  
          then:
          dto.slots ==  /*dto value that I get*/
          dto.count == 4
      }
  </code></pre>
  
  <p>Can someone please tell me what I'm doing wrong? Thanks in advance. </p>