mirror of https://github.com/qwc/backive.git
Fix code to pass tests
This commit is contained in:
parent
5b092b1988
commit
b8f92c68ba
|
@ -52,7 +52,7 @@ func (b *Backup) CanRun() error {
|
||||||
return fmt.Errorf("the setting targetPath MUST exist within a backup configuration")
|
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
|
// 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")
|
return fmt.Errorf("the setting scriptPath must exist within a backup configuration")
|
||||||
}
|
}
|
||||||
if !b.ShouldRun() {
|
if !b.ShouldRun() {
|
||||||
|
|
|
@ -68,6 +68,7 @@ func TestCanRun(t *testing.T) {
|
||||||
}
|
}
|
||||||
err = bkpScriptPathMissing.CanRun()
|
err = bkpScriptPathMissing.CanRun()
|
||||||
if err == nil {
|
if err == nil {
|
||||||
|
t.Logf("ScriptPath is %v", bkpScriptPathMissing.ScriptPath)
|
||||||
t.Log("Missing scriptPath has to fail function 'CanRun()'")
|
t.Log("Missing scriptPath has to fail function 'CanRun()'")
|
||||||
t.Fail()
|
t.Fail()
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue