Skip to content

Commit

Permalink
completed test for all cases
Browse files Browse the repository at this point in the history
  • Loading branch information
warrensbox committed May 22, 2018
1 parent d3fc91f commit a170e54
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions main_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
package main_test

import (
"os/user"
"testing"
)

// TestMain : check to see if user exist
func TestMain(t *testing.T) {

t.Run("User should exist",
func(t *testing.T) {
usr, errCurr := user.Current()
if errCurr != nil {
t.Errorf("Unable to get user %v [unexpected]", errCurr)
}

if usr != nil {
t.Logf("Current user exist: %v [expected]\n", usr.HomeDir)
} else {
t.Error("Unable to get user [unexpected]")
}
},
)
}

0 comments on commit a170e54

Please sign in to comment.