Skip to content

Commit

Permalink
Merge pull request #229 from m4ns0ur/test-repo-files
Browse files Browse the repository at this point in the history
Add test for checking specific repo files
  • Loading branch information
Matt Bernier authored Nov 11, 2017
2 parents 64f7d73 + 6329241 commit ece97af
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions sendgrid_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,21 @@ func TestLicenseYear(t *testing.T) {
}
}

func TestRepoFiles(t *testing.T) {
fs := []string{"Dockerfile", "docker-compose.yml", ".env_sample", ".gitignore", ".travis.yml", ".codeclimate.yml", "CHANGELOG.md", "CODE_OF_CONDUCT.md", "CONTRIBUTING.md", ".github/ISSUE_TEMPLATE", "LICENSE.txt", ".github/PULL_REQUEST_TEMPLATE", "README.md", "TROUBLESHOOTING.md", "USAGE.md", "USE_CASES.md"}
for _, f := range fs {
if _, err := os.Stat(f); os.IsNotExist(err) {
if strings.HasPrefix(strings.ToLower(f), "docker") {
if _, err := os.Stat("docker/" + f); os.IsNotExist(err) {
t.Errorf("Repo files do not exist: %[1]v or docker/%[1]v", f)
}
} else {
t.Errorf("Repo file does not exist: %v", f)
}
}
}
}

func TestGetRequest(t *testing.T) {
request := GetRequest("", "", "")
if request.BaseURL != "https://api.sendgrid.com" {
Expand Down

0 comments on commit ece97af

Please sign in to comment.