1
0
mirror of https://github.com/jhillyerd/inbucket.git synced 2026-01-28 22:15:56 +00:00

Use MockDataStore for handler_test.go

This commit is contained in:
James Hillyerd
2013-11-06 17:18:56 -08:00
parent ef48b9c2dd
commit d80521b24d
2 changed files with 40 additions and 20 deletions

View File

@@ -69,7 +69,8 @@ type MockDataStore struct {
}
func (m *MockDataStore) MailboxFor(name string) (Mailbox, error) {
return nil, nil
args := m.Called()
return args.Get(0).(Mailbox), args.Error(1)
}
func (m *MockDataStore) AllMailboxes() ([]Mailbox, error) {
@@ -158,8 +159,8 @@ func (m *MockMessage) Size() int64 {
}
func (m *MockMessage) Append(data []byte) error {
args := m.Called(data)
return args.Error(0)
// []byte arg seems to mess up testify/mock
return nil
}
func (m *MockMessage) Close() error {