Add test for bad shell args

This commit is contained in:
Max Claus Nunes 2018-07-24 22:37:03 -03:00
parent 15d3ba41d3
commit f0b6bfbe00
1 changed files with 22 additions and 0 deletions

View File

@ -268,3 +268,25 @@ func TestGaperRestartRunFail(t *testing.T) {
mockBuilder.AssertExpectations(t)
mockRunner.AssertExpectations(t)
}
func TestGaperFailBadBuildArgsMerged(t *testing.T) {
args := &Config{
BuildArgsMerged: "foo '",
}
chOSSiginal := make(chan os.Signal, 2)
err := Run(args, chOSSiginal)
assert.NotNil(t, err, "run error")
assert.Equal(t, "invalid command line string", err.Error())
}
func TestGaperFailBadProgramArgsMerged(t *testing.T) {
args := &Config{
ProgramArgsMerged: "foo '",
}
chOSSiginal := make(chan os.Signal, 2)
err := Run(args, chOSSiginal)
assert.NotNil(t, err, "run error")
assert.Equal(t, "invalid command line string", err.Error())
}