Add acceptance tests for org command

This commit is contained in:
bagtoad 2024-10-24 09:58:06 -06:00
parent 76e6fbba36
commit 2f849f03ff
2 changed files with 15 additions and 0 deletions

View file

@ -135,6 +135,15 @@ func TestSSHKeys(t *testing.T) {
testscript.Run(t, testScriptParamsFor(tsEnv, "ssh-key"))
}
func TestOrg(t *testing.T) {
var tsEnv testScriptEnv
if err := tsEnv.fromEnv(); err != nil {
t.Fatal(err)
}
testscript.Run(t, testScriptParamsFor(tsEnv, "org"))
}
func testScriptParamsFor(tsEnv testScriptEnv, command string) testscript.Params {
var files []string
if tsEnv.script != "" {

View file

@ -0,0 +1,6 @@
# This test could fail if the user is a member of more than 30 organizations because
# the `gh org list` command only returns the first 30 organizations the user is a member of
# List organizations the user is a member of
exec gh org list
stdout ${GH_ACCEPTANCE_ORG}