Ensured exit status is set on failure
This commit is contained in:
parent
6faea5a8f4
commit
8a5b9c9431
2 changed files with 47 additions and 28 deletions
|
@ -20,6 +20,7 @@ import org.junit.jupiter.api.Test;
|
|||
import rife.bld.BaseProject;
|
||||
import rife.bld.Project;
|
||||
import rife.bld.WebProject;
|
||||
import rife.bld.operations.exceptions.ExitStatusException;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.nio.file.Files;
|
||||
|
@ -29,7 +30,8 @@ import java.util.Set;
|
|||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
import static org.assertj.core.api.Assertions.assertThatCode;
|
||||
import static rife.bld.extension.PitestOperation.*;
|
||||
import static rife.bld.extension.PitestOperation.FALSE;
|
||||
import static rife.bld.extension.PitestOperation.TRUE;
|
||||
|
||||
class PitestOperationTest {
|
||||
private static final String AS_LIST = "as list";
|
||||
|
@ -287,6 +289,12 @@ class PitestOperationTest {
|
|||
"--sourceDirs c:\\myProject\\src");
|
||||
}
|
||||
|
||||
@Test
|
||||
void executeNoProject() {
|
||||
var op = new PitestOperation();
|
||||
assertThatCode(op::execute).isInstanceOf(ExitStatusException.class);
|
||||
}
|
||||
|
||||
@Test
|
||||
void exportLineCoverage() {
|
||||
var op = new PitestOperation()
|
||||
|
@ -547,12 +555,12 @@ class PitestOperationTest {
|
|||
var op = new PitestOperation()
|
||||
.fromProject(new BaseProject())
|
||||
.sourceDirs(FOO, BAR);
|
||||
assertThat(op.options().get(SOURCE_DIRS)).isEqualTo(FOOBAR);
|
||||
assertThat(op.options().get("--sourceDirs")).isEqualTo(FOOBAR);
|
||||
|
||||
op = new PitestOperation()
|
||||
.fromProject(new Project())
|
||||
.sourceDirs(List.of(FOO, BAR));
|
||||
assertThat(op.options().get(SOURCE_DIRS)).as(AS_LIST).isEqualTo(FOOBAR);
|
||||
assertThat(op.options().get("--sourceDirs")).as(AS_LIST).isEqualTo(FOOBAR);
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue