title: How to test methods that return Future?
body: <p>I'd like to test a method that returns a <code>Future</code>. My attempts were as follows:</p>
  
  <pre><code>import  org.specs2.mutable.Specification
  import scala.concurrent.ExecutionContext.Implicits.global
  import scala.util.{Failure, Success}
  
  class AsyncWebClientSpec extends Specification{
  
    "WebClient when downloading images" should {
      "for a valid link return non-zero content " in {
        val testImage = AsyncWebClient.get("https://www.google.cz/images/srpr/logo11ww.png")
        testImage.onComplete { res =&gt; 
          res match {
            case Success(image) =&gt; image must not have length(0)
            case _ =&gt;
          }
          AsyncWebClient.shutDown
        }
      }
    }
  }
  </code></pre>
  
  <p>Apart from the fact that I am unable to make this code work I guess that there could be a better way of testing a futures with a <code>Future</code>-oriented matcher.</p>
  
  <p>How to do it properly in specs2?</p>