diff --git a/acceptance/acceptance_test.go b/acceptance/acceptance_test.go index 51e96778a..366d88cf4 100644 --- a/acceptance/acceptance_test.go +++ b/acceptance/acceptance_test.go @@ -72,6 +72,14 @@ func TestReleases(t *testing.T) { testscript.Run(t, testScriptParamsFor(tsEnv, "release")) } +func TestRepos(t *testing.T) { + var tsEnv testScriptEnv + if err := tsEnv.fromEnv(); err != nil { + t.Fatal(err) + } + testscript.Run(t, testScriptParamsFor(tsEnv, "repos")) +} + func testScriptParamsFor(tsEnv testScriptEnv, command string) testscript.Params { var files []string if tsEnv.script != "" { diff --git a/acceptance/testdata/repos/repo-create-view.txtar b/acceptance/testdata/repos/repo-create-view.txtar new file mode 100644 index 000000000..b5b85f593 --- /dev/null +++ b/acceptance/testdata/repos/repo-create-view.txtar @@ -0,0 +1,12 @@ +# 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 + +# Defer repo cleanup +defer gh repo delete --yes $ORG/$SCRIPT_NAME-$RANDOM_STRING + +# Check that the repo exists +exec gh repo view $ORG/$SCRIPT_NAME-$RANDOM_STRING --json name --jq '.name' +stdout $SCRIPT_NAME-$RANDOM_STRING \ No newline at end of file