Skip to content

Commit 5aebb94

Browse files
committed
add ExpectDo method
1 parent fa3063a commit 5aebb94

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

expect.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ type baseMock interface {
2727
// MatchExpectationsInOrder gives an option whether to match all expectations in the order they were set or not.
2828
MatchExpectationsInOrder(b bool)
2929

30+
ExpectDo(args ...interface{}) *ExpectedCmd
3031
ExpectIntSliceDo(args ...interface{}) *ExpectedIntSlice
3132
ExpectIntDo(args ...interface{}) *ExpectedInt
3233
ExpectStringSliceDo(args ...interface{}) *ExpectedStringSlice

mock.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -408,6 +408,13 @@ func (m *mock) ExpectWatch(keys ...string) *ExpectedError {
408408
return e
409409
}
410410

411+
func (m *mock) ExpectDo(args ...interface{}) *ExpectedCmd {
412+
e := &ExpectedCmd{}
413+
e.cmd = redis.NewCmd(m.ctx, args...)
414+
m.pushExpect(e)
415+
return e
416+
}
417+
411418
func (m *mock) ExpectIntSliceDo(args ...interface{}) *ExpectedIntSlice {
412419
e := &ExpectedIntSlice{}
413420
e.cmd = redis.NewIntSliceCmd(m.ctx, args...)

0 commit comments

Comments
 (0)