These are chat archives for etorreborre/specs2

Nov 2015
Nov 10 2015 13:52

Hi! How can I test invocations to a logger with exceptions? Example

trait Logger {
  def error(msg: => String, t: Throwable)
val logger = mock[Logger]
there was one(loggerMock).error("msg", new IllegalArgumentException("msg"))

This does not work for me (specs 2.4.14) because as I suppose comparing my new IAE is not equal to one passed to logger in my test case, because they are not hash-code equal...
Any ideas?