Commit 1e247d17 authored by James Lopez's avatar James Lopez

refactored code a bit

parent f0d01590
......@@ -208,8 +208,8 @@ func TestRunWrongAttempts(t *testing.T) {
// Fail a build script
e.On("Shell").Return(&ShellScriptInfo{Shell: "script-shell"})
e.On("Run", mock.Anything).Return(errors.New("Number of attempts out of the range [1, 10]"))
e.On("Finish", errors.New("Number of attempts out of the range [1, 10]")).Return()
e.On("Run", mock.Anything).Return(errors.New("Number of attempts specified in PRE_BUILD_ATTEMPTS out of the range [1, 10]"))
e.On("Finish", errors.New("Number of attempts specified in PRE_BUILD_ATTEMPTS out of the range [1, 10]")).Return()
RegisterExecutor("build-run-attempt-failure", &p)
......@@ -226,5 +226,5 @@ func TestRunWrongAttempts(t *testing.T) {
build.Variables = append(build.Variables, BuildVariable{Key: "PRE_BUILD_ATTEMPTS", Value: "0"})
err = build.Run(&Config{}, &Trace{Writer: os.Stdout})
assert.EqualError(t, err, "Number of attempts out of the range [1, 10]")
assert.EqualError(t, err, "Number of attempts specified in PRE_BUILD_ATTEMPTS out of the range [1, 10]")
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment