Skip to content

Commit

Permalink
add ExpectDo method
Browse files Browse the repository at this point in the history
  • Loading branch information
ryantate13 committed Feb 15, 2022
1 parent fa3063a commit 5aebb94
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions expect.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ type baseMock interface {
// MatchExpectationsInOrder gives an option whether to match all expectations in the order they were set or not.
MatchExpectationsInOrder(b bool)

ExpectDo(args ...interface{}) *ExpectedCmd
ExpectIntSliceDo(args ...interface{}) *ExpectedIntSlice
ExpectIntDo(args ...interface{}) *ExpectedInt
ExpectStringSliceDo(args ...interface{}) *ExpectedStringSlice
Expand Down
7 changes: 7 additions & 0 deletions mock.go
Original file line number Diff line number Diff line change
Expand Up @@ -408,6 +408,13 @@ func (m *mock) ExpectWatch(keys ...string) *ExpectedError {
return e
}

func (m *mock) ExpectDo(args ...interface{}) *ExpectedCmd {
e := &ExpectedCmd{}
e.cmd = redis.NewCmd(m.ctx, args...)
m.pushExpect(e)
return e
}

func (m *mock) ExpectIntSliceDo(args ...interface{}) *ExpectedIntSlice {
e := &ExpectedIntSlice{}
e.cmd = redis.NewIntSliceCmd(m.ctx, args...)
Expand Down

0 comments on commit 5aebb94

Please sign in to comment.