Skip to content

Commit 256e78d

Browse files
ideasculptorSamuel Gendler
authored andcommitted
add Do() commands to mock
1 parent aaa7c80 commit 256e78d

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

mock.go

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -447,7 +447,34 @@ func (m *mock) ExpectDo(args ...interface{}) *ExpectedCmd {
447447
default:
448448
panic("ExpectDo: unsupported client type")
449449
}
450+
m.pushExpect(e)
451+
return e
452+
}
453+
454+
func (m *mock) ExpectIntSliceDo(args ...interface{}) *ExpectedIntSlice {
455+
e := &ExpectedIntSlice{}
456+
e.cmd = redis.NewCmd(m.ctx, args)
457+
m.pushExpect(e)
458+
return e
459+
}
450460

461+
func (m *mock) ExpectIntDo(args ...interface{}) *ExpectedInt {
462+
e := &ExpectedInt{}
463+
e.cmd = redis.NewCmd(m.ctx, args)
464+
m.pushExpect(e)
465+
return e
466+
}
467+
468+
func (m *mock) ExpectStringDo(args ...interface{}) *ExpectedString {
469+
e := &ExpectedString{}
470+
e.cmd = redis.NewCmd(m.ctx, args)
471+
m.pushExpect(e)
472+
return e
473+
}
474+
475+
func (m *mock) ExpectStringSliceDo(args ...interface{}) *ExpectedStringSlice {
476+
e := &ExpectedStringSlice{}
477+
e.cmd = redis.NewCmd(m.ctx, args)
451478
m.pushExpect(e)
452479
return e
453480
}

0 commit comments

Comments
 (0)