stretchr/testify — pull request #23 by realistschuckle (2013-10-05 04:33:19+00:00)
Title: Added Repeatability Statements to Expectations

**Fully backward-compatible addition**

I use testify in all of my Go programming. I need some "repeat-bounding" semantics to continue using it in realistschuckle/gohaml. This pull request adds the following capability without changing the expectations of existing testify/mock code:

```go
func Test_My_Mock_Returns_Different_Values(t *testing.T) {
mock := &myMock{}
mock.On("ExpectedMethod", 1).Return("Hello").Once()
mock.On("ExpectedMethod", 1).Return("Good-bye").Twice()

assert.Equal(t, "Hello", mock.ExpectedMethod(1))
assert.Equal(t, "Good-bye", mock.ExpectedMethod(1))

tt = new(testing.T)
assert.False(mock.AssertExpectations(tt))

assert.Equal(t, "Good-bye", mock.ExpectedMethod(1))
mock.AssertExpectations(t)

assert.Panics(t, func() {
mock.ExpectedMethod(1)
})
}
```

All of your tests still exist in their unchanged form with the exception of Test_Mock_findExpectedCall which should bother no one since you do not export that method.