github.com/vlifesystems/rulehunter@v0.0.0-20180501090014-673078aa4a83/cmd/errors_test.go (about) 1 package cmd 2 3 import ( 4 "errors" 5 "testing" 6 ) 7 8 func TestErrConfigLoadError(t *testing.T) { 9 err := errConfigLoad{ 10 filename: "/tmp/config.yaml", 11 err: errors.New("baby did a bad thing"), 12 } 13 want := 14 "couldn't load configuration file: /tmp/config.yaml: baby did a bad thing" 15 got := err.Error() 16 if got != want { 17 t.Errorf("Error() got: %s, want: %s", got, want) 18 } 19 }