diff --git a/commands.go b/commands.go index d0085390..6321c15e 100644 --- a/commands.go +++ b/commands.go @@ -422,6 +422,12 @@ func (c cmdable) Ping(ctx context.Context) *StatusCmd { return cmd } +func (c cmdable) Do(ctx context.Context, args ...interface{}) *Cmd { + cmd := NewCmd(ctx, args...) + _ = c(ctx, cmd) + return cmd +} + func (c cmdable) Quit(_ context.Context) *StatusCmd { panic("not implemented") } diff --git a/commands_test.go b/commands_test.go index a9e90fc9..55b95749 100644 --- a/commands_test.go +++ b/commands_test.go @@ -84,6 +84,12 @@ var _ = Describe("Commands", func() { Expect(ping.Val()).To(Equal("PONG")) }) + It("should Ping with Do method", func() { + result := client.Conn().Do(ctx, "PING") + Expect(result.Err()).NotTo(HaveOccurred()) + Expect(result.Val()).To(Equal("PONG")) + }) + It("should Wait", func() { const wait = 3 * time.Second