title: How to define a custom argument matcher with mockito in spec2?
body: <p>I want to verify if the business logic passes the expected <code>user</code> object to dao, but I can't figure how to write an custom argument matcher for it.</p>
  
  <pre><code>"user" should {
      "be saved" in {
          val dao = new UserDao()
          dao.save(any[User]) returns mock[User]
  
          runMyBusinessLogic();
  
          val expectedUser = new User("Freewind", 123.23234)
          there was one(dao).save(mymatcher(expectedUser));
      }
   }
  </code></pre>
  
  <p>The <code>User</code> class:</p>
  
  <pre><code>case class User(name:String, random: Double)
  </code></pre>
  
  <p>Which contains a <code>double</code> field, that I need to do some special comparison for it.</p>
  
  <p>The <code>mymatcher</code> is the matcher I want to define:</p>
  
  <pre><code>def mymatcher(expected: User) = ??? {
      // compare `name` and `random`
  }
  </code></pre>
  
  <p>But I don't know how to do it in <code>spec2</code>, and can't find any useful documents. Any helps?</p>