From aef81c8a432213c18617de699dd107ff8dad7a98 Mon Sep 17 00:00:00 2001 From: Gabriel Lima Date: Sun, 29 Oct 2017 17:52:41 -0200 Subject: [PATCH] create test for required repo files --- smtpapi_test.go | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/smtpapi_test.go b/smtpapi_test.go index b92fc9f..214384c 100644 --- a/smtpapi_test.go +++ b/smtpapi_test.go @@ -3,6 +3,7 @@ package smtpapi import ( "encoding/json" "io/ioutil" + "os" "reflect" "testing" ) @@ -369,3 +370,16 @@ func TestMarshalUnmarshall(t *testing.T) { t.Errorf("Expected %v, but got %v", header, newHeader) } } + +func TestRepoFiles(t *testing.T) { + files := []string{"docker/Docker", "docker/docker-compose.yml", ".env_sample", + ".gitignore", ".travis.yml", ".codeclimate.yml", "CHANGELOG.md", "CODE_OF_CONDUCT.md", + "CONTRIBUTING.md", ".github/ISSUE_TEMPLATE", "LICENSE.md", ".github/PULL_REQUEST_TEMPLATE", + "README.md", "TROUBLESHOOTING.md", "USAGE.md", "USE_CASES.md"} + + for _, file := range files { + if _, err := os.Stat(file); os.IsNotExist(err) { + t.Errorf("Repo file does not exist: %v", file) + } + } +}