From 08f7706c4287b0bae04b5d8b2efb05ab01da23c0 Mon Sep 17 00:00:00 2001 From: danochoa Date: Sun, 12 Jan 2025 19:18:24 -0600 Subject: [PATCH] fix tests --- pkg/cmd/gist/delete/delete_test.go | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/pkg/cmd/gist/delete/delete_test.go b/pkg/cmd/gist/delete/delete_test.go index 97a7e11d3..fa311b07e 100644 --- a/pkg/cmd/gist/delete/delete_test.go +++ b/pkg/cmd/gist/delete/delete_test.go @@ -214,7 +214,7 @@ func Test_deleteRun(t *testing.T) { wantErr: true, }, { - name: "not found", + name: "not owned by you", opts: &DeleteOptions{ Selector: "1234", }, @@ -227,6 +227,19 @@ func Test_deleteRun(t *testing.T) { wantErr: true, wantStderr: "unable to delete gist \"cool.txt\": either the gist is not found or it is not owned by you", }, + { + name: "not found", + opts: &DeleteOptions{ + Selector: "1234", + }, + httpStubs: func(reg *httpmock.Registry) { + reg.Register(httpmock.REST("GET", "gists/1234"), + httpmock.StatusStringResponse(404, "{}")) + }, + noGists: true, + wantErr: true, + wantStderr: "not found", + }, { name: "no gists", opts: &DeleteOptions{