From cbc95e6b5adecf276d857020c7f5a9ad9b4a2101 Mon Sep 17 00:00:00 2001 From: Dmitry Matrosov Date: Mon, 11 Sep 2017 09:54:35 +1000 Subject: [PATCH] Update the example in the README The example used an outdated method `CallsTo` which is no longer generated when creating a mock. --- README.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 15ee36c..06137df 100644 --- a/README.md +++ b/README.md @@ -74,8 +74,9 @@ func TestCompleteSignup(t *testing.T) { CompleteSignUp("me@email.com", mockedEmailSender) - if mockedEmailSender.CallsTo.Send != 1 { - t.Errorf("Send was called %d times", mockedEmailSender.CallsTo.Send) + callsToSend := len(mockedEmailSender.SendCalls()) + if callsToSend != 1 { + t.Errorf("Send was called %d times", callsToSend) } if sentTo != "me@email.com" { t.Errorf("unexpected recipient: %s", sentTo)