Skip to content

Commit

Permalink
Fix code to pass tests
Browse files Browse the repository at this point in the history
  • Loading branch information
qwc committed Feb 12, 2022
1 parent 5b092b1 commit b8f92c6
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion backup.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ func (b *Backup) CanRun() error {
return fmt.Errorf("the setting targetPath MUST exist within a backup configuration")
}
// script must exist, having only script means this is handled in the script
if b.ScriptPath == "" {
if b.ScriptPath == nil {
return fmt.Errorf("the setting scriptPath must exist within a backup configuration")
}
if !b.ShouldRun() {
Expand Down
1 change: 1 addition & 0 deletions backup_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ func TestCanRun(t *testing.T) {
}
err = bkpScriptPathMissing.CanRun()
if err == nil {
t.Logf("ScriptPath is %v", bkpScriptPathMissing.ScriptPath)
t.Log("Missing scriptPath has to fail function 'CanRun()'")
t.Fail()
}
Expand Down

0 comments on commit b8f92c6

Please sign in to comment.