Skip to content

Commit

Permalink
Fixed exit status checks
Browse files Browse the repository at this point in the history
  • Loading branch information
ethauvin committed Jul 23, 2024
1 parent 8f4bb51 commit 68f3b81
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/test/java/rife/bld/extension/ExecOperationTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import rife.bld.BaseProject;
import rife.bld.Project;
import rife.bld.WebProject;
import rife.bld.operations.exceptions.ExitStatusException;

import java.io.File;
import java.util.List;
Expand Down Expand Up @@ -53,7 +54,7 @@ void testExitValue() {
new ExecOperation()
.fromProject(new BaseProject())
.command(List.of("cat", FOO))
.execute()).message().contains("exit value/status");
.execute()).isInstanceOf(ExitStatusException.class);
}

@Test
Expand All @@ -76,7 +77,7 @@ void testTimeout() {
.timeout(5)
.command(List.of("sleep", "10"));
assertThat(op.timeout()).isEqualTo(5);
assertThatCode(op::execute).message().contains("timed out");
assertThatCode(op::execute).isInstanceOf(ExitStatusException.class);
}

@Test
Expand Down Expand Up @@ -110,6 +111,6 @@ void testWorkDirInvalid() {
.fromProject(new BaseProject())
.command("echo")
.workDir(FOO)
.execute()).message().startsWith("Invalid working directory: ").endsWith(FOO);
.execute()).isInstanceOf(ExitStatusException.class);
}
}

0 comments on commit 68f3b81

Please sign in to comment.