From 83cbdc4f3686cbfd1500ce71820d2e23997bcdee Mon Sep 17 00:00:00 2001 From: Tyler McGoffin Date: Wed, 16 Oct 2024 15:28:38 -0700 Subject: [PATCH] Added acceptance test for repo-delete --- acceptance/testdata/repos/repo-delete.txtar | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 acceptance/testdata/repos/repo-delete.txtar diff --git a/acceptance/testdata/repos/repo-delete.txtar b/acceptance/testdata/repos/repo-delete.txtar new file mode 100644 index 000000000..855473ae9 --- /dev/null +++ b/acceptance/testdata/repos/repo-delete.txtar @@ -0,0 +1,16 @@ +# Use gh as a credential helper +exec gh auth setup-git + +# Create a repository with a file so it has a default branch +exec gh repo create $ORG/$SCRIPT_NAME-$RANDOM_STRING --add-readme --private + +# Check that the repo exists +exec gh repo view $ORG/$SCRIPT_NAME-$RANDOM_STRING --json name --jq '.name' +stdout $SCRIPT_NAME-$RANDOM_STRING + +# Delete the repo +exec gh repo delete --yes $ORG/$SCRIPT_NAME-$RANDOM_STRING + +# Ensure that the repo was deleted +! exec gh repo view $ORG/$SCRIPT_NAME-$RANDOM_STRING --json name --jq '.name' +stderr 'Could not resolve to a Repository with the name' \ No newline at end of file