From 0cd8a88dca3f6ef8b1e282a193fbcd468fbbc37d Mon Sep 17 00:00:00 2001 From: Austin Vazquez <55906459+austinvazquez@users.noreply.github.com> Date: Sat, 28 Dec 2024 20:51:01 -0600 Subject: [PATCH] feat: create volume command should be idempotent (#199) Signed-off-by: Austin Vazquez --- tests/volume_create.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tests/volume_create.go b/tests/volume_create.go index a2bb1fa..a538a35 100644 --- a/tests/volume_create.go +++ b/tests/volume_create.go @@ -64,9 +64,11 @@ func VolumeCreate(o *option.Option) { gomega.Expect(tag1).Should(gomega.Equal("tag1")) }) - ginkgo.It("should not create a volume if the volume with the same name exists", func() { + ginkgo.It("should warn volume already exists if a volume with the same name exists", func() { command.Run(o, "volume", "create", testVolumeName) - command.RunWithoutSuccessfulExit(o, "volume", "create", testVolumeName) + session := command.Run(o, "volume", "create", testVolumeName) + gomega.Expect(string(session.Err.Contents())).Should(gomega.ContainSubstring("already exists")) + gomega.Expect(string(session.Out.Contents())).Should(gomega.ContainSubstring(testVolumeName)) }) }) }