Skip to content

Commit

Permalink
Merge pull request #225 from m4ns0ur/test-license-year
Browse files Browse the repository at this point in the history
Add test for license date range
  • Loading branch information
Matt Bernier authored Oct 28, 2017
2 parents 2a8c1d4 + fa13859 commit 87a19c8
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions sendgrid_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"encoding/json"
"fmt"
"io"
"io/ioutil"
"net/http"
"net/http/httptest"
"os"
Expand Down Expand Up @@ -119,6 +120,17 @@ func TestSendGridVersion(t *testing.T) {
}
}

func TestLicenseYear(t *testing.T) {
d, err := ioutil.ReadFile("LICENSE.txt")
if err != nil {
t.Error("Cannot read the LICENSE.txt file")
}
l := fmt.Sprintf("Copyright (c) 2013-%v SendGrid, Inc.", time.Now().Year())
if !strings.Contains(string(d), l) {
t.Errorf("License date range is not correct, it should be: %v", l)
}
}

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

0 comments on commit 87a19c8

Please sign in to comment.