Handle executable not found in exec

This commit is contained in:
Sami Wagiaalla
2015-10-29 15:24:19 -04:00
parent 13e68d2a87
commit 4d373b133a
2 changed files with 22 additions and 6 deletions

View File

@@ -92,3 +92,12 @@ func TestLookPath(t *testing.T) {
t.Errorf("unexpected result for LookPath: got %s, expected %s", sh, shExpected)
}
}
func TestExecutableNotFound(t *testing.T) {
exec := New()
cmd := exec.Command("fake_executable_name")
_, err := cmd.CombinedOutput()
if err != ErrExecutableNotFound {
t.Errorf("Expected error ErrExecutableNotFound but got %v", err)
}
}