use of com.thoughtworks.go.config.ExecTask in project gocd by gocd.
the class ExecTaskBuilderTest method shouldUseProjectDefaultWorkingDirectoryIfNotSpecified.
@Test
void shouldUseProjectDefaultWorkingDirectoryIfNotSpecified() {
ExecTask task = new ExecTask("command", "", (String) null);
final File defaultWorkingDir = new File("foo");
CommandBuilder builder = (CommandBuilder) execTaskBuilder.createBuilder(builderFactory, task, pipelineStub("label", "foo"), resolver);
assertThat(builder.getWorkingDir()).isEqualTo(defaultWorkingDir);
}
use of com.thoughtworks.go.config.ExecTask in project gocd by gocd.
the class ExecTaskTest method validateTask_shouldValidateThatCommandIsRequired.
@Test
public void validateTask_shouldValidateThatCommandIsRequired() {
ExecTask execTask = new ExecTask();
execTask.validateTask(null);
assertThat(execTask.errors().isEmpty(), is(false));
assertThat(execTask.errors().on(ExecTask.COMMAND), is("Command cannot be empty"));
}
Aggregations