Skip to content

Commit

Permalink
Correct typos in commented lines
Browse files Browse the repository at this point in the history
  • Loading branch information
Gus Carreon authored and Gus Carreon committed Nov 4, 2019
1 parent 79f211b commit 4ba89df
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions ssl/ssl_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ func TestCertsFromFilePoolExists(t *testing.T) {
// Load hardcoded certificates found in ssl.go
certPool := GetRootCAPool()

// Assert loaded certificates by looking at the lenght of the subjects array of strings
// Assert loaded certificates by looking at the length of the subjects array of strings
subjects := certPool.Subjects()
hardCodedSubNum := len(subjects)
assert.True(t, hardCodedSubNum > 0)
Expand All @@ -20,7 +20,7 @@ func TestCertsFromFilePoolExists(t *testing.T) {
certificatesFile := "mockcertificates/mock-certs.pem"
certPool, err := AppendPEMFileToRootCAPool(certPool, certificatesFile)

// Assert loaded certificates by looking at the lenght of the subjects array of strings
// Assert loaded certificates by looking at the length of the subjects array of strings
assert.NoError(t, err, "Error thrown by AppendPEMFileToRootCAPool while loading file %s: %v", certificatesFile, err)
subjects = certPool.Subjects()
subNumIncludingFile := len(subjects)
Expand All @@ -35,7 +35,7 @@ func TestCertsFromFilePoolDontExist(t *testing.T) {
certificatesFile := "mockcertificates/mock-certs.pem"
certPool, err := AppendPEMFileToRootCAPool(certPool, certificatesFile)

// Assert loaded certificates by looking at the lenght of the subjects array of strings
// Assert loaded certificates by looking at the length of the subjects array of strings
assert.NoError(t, err, "Error thrown by AppendPEMFileToRootCAPool while loading file %s: %v", certificatesFile, err)
subjects := certPool.Subjects()
assert.Equal(t, len(subjects), 1, "We only loaded one vertificate from the file, len(subjects) should equal 1")
Expand All @@ -45,10 +45,10 @@ func TestAppendPEMFileToRootCAPoolFail(t *testing.T) {
// Empty certpool
var certPool *x509.CertPool

// Load certificates from file
// In this test we are going to pass a file that does not exist as value of second argument
fakeCertificatesFile := "mockcertificates/NO-FILE.pem"
certPool, err := AppendPEMFileToRootCAPool(certPool, fakeCertificatesFile)

// Assert loaded certificates by looking at the lenght of the subjects array of strings
// Assert AppendPEMFileToRootCAPool correctly throws an error when trying to load an nonexisting file
assert.Errorf(t, err, "AppendPEMFileToRootCAPool should throw an error by while loading fake file %s \n", fakeCertificatesFile)
}

0 comments on commit 4ba89df

Please sign in to comment.