diff --git a/toml.go b/toml.go index e86374b..139fd0d 100644 --- a/toml.go +++ b/toml.go @@ -1,6 +1,7 @@ package staert import ( + "fmt" "os" "path/filepath" "strings" @@ -34,7 +35,7 @@ func (ts *TomlSource) ConfigFileUsed() string { func (ts *TomlSource) Parse(cmd *flaeg.Command) (*flaeg.Command, error) { ts.fullPath = findFile(ts.filename, ts.dirNFullPath) if len(ts.fullPath) < 2 { - return cmd, nil + return cmd, fmt.Errorf("unable to find config file on disk") } metadata, err := toml.DecodeFile(ts.fullPath, cmd.Config) diff --git a/toml_test.go b/toml_test.go index 8039425..42e1784 100644 --- a/toml_test.go +++ b/toml_test.go @@ -71,8 +71,8 @@ func TestTomlSource_Parse_FileNotFound(t *testing.T) { } command, err := src.Parse(cmd) - require.NoError(t, err) + assert.Error(t, err, "unable to find config file on disk") assert.Exactly(t, cmd, command) }