-
-
Notifications
You must be signed in to change notification settings - Fork 67
/
Copy pathtypes_test.go
34 lines (23 loc) · 1.46 KB
/
types_test.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
package types
import (
"testing"
"github.com/stretchr/testify/assert"
)
// TestCustomErrorStatements performs quick sanity checks on the custom error types to ensure they return the expected messages
func TestCustomErrorStatements(t *testing.T) {
t.Parallel()
err := &NoArgumentsPassedErr{}
assert.Equal(t, "You must pass a valid command or script path to git-xargs", err.Error())
errNoGithubOrg := &NoGithubOrgSuppliedErr{}
assert.Equal(t, "You must pass a valid Github organization name", errNoGithubOrg.Error())
errNoRepoSelected := &NoRepoSelectionsMadeErr{}
assert.Equal(t, "You must target some repos for processing either via stdin or by providing one of the --github-org, --repos, or --repo flags", errNoRepoSelected.Error())
errNoReposFound := &NoReposFoundErr{GithubOrg: "gruntwork-io"}
assert.Equal(t, "No repos found for the organization supplied via --github-org: gruntwork-io", errNoReposFound.Error())
errNoValidReposFoundAfterFiltering := NoValidReposFoundAfterFilteringErr{}
assert.Equal(t, "No valid repos were found after filtering out malformed input", errNoValidReposFoundAfterFiltering.Error())
errNoCommandSupplied := NoCommandSuppliedErr{}
assert.Equal(t, "You must supply a valid command or script to execute", errNoCommandSupplied.Error())
errNoGithubOauthTokenProvided := NoGithubOauthTokenProvidedErr{}
assert.Equal(t, "You must export a valid Github personal access token as GITHUB_OAUTH_TOKEN", errNoGithubOauthTokenProvided.Error())
}