ArgumentCaptor
in Scala - turns out someone else had the same thought, and it's already fixed in Specs2:
"Application Main Controller" should { "Pass a non-empty list to the template" in { val result = controller.newsAction(FakeRequest()) status(result) must beEqualTo(200) val captor = capture[List[String]] there was one(mockedNewsRenderer).apply(captor) val theArgument = captor.value theArgument.isEmpty must beFalse } }
Nice.
No comments:
Post a Comment
Comments welcome - spam is not. Spam will be detected, deleted and the source IP blocked.