A File can now also be used to specify the working dir
This commit is contained in:
parent
e7d3060649
commit
2a2c81994a
2 changed files with 39 additions and 18 deletions
|
@ -53,12 +53,12 @@ class ExecOperationTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
void testExitStatus() {
|
||||
void testExitValue() {
|
||||
assertThatCode(() ->
|
||||
new ExecOperation()
|
||||
.fromProject(new BaseProject())
|
||||
.command(List.of("cat", FOO))
|
||||
.execute()).message().contains("exit status");
|
||||
.execute()).message().contains("exit value/status");
|
||||
}
|
||||
|
||||
@Test
|
||||
|
@ -83,11 +83,21 @@ class ExecOperationTest {
|
|||
|
||||
@Test
|
||||
void testWorkDir() {
|
||||
assertThatCode(() ->
|
||||
new ExecOperation()
|
||||
.fromProject(new BaseProject())
|
||||
.command("echo", FOO)
|
||||
.workDir(new File(System.getProperty("java.io.tmpdir")))
|
||||
.execute()).doesNotThrowAnyException();
|
||||
}
|
||||
|
||||
@Test
|
||||
void testWorkDirInvalid() {
|
||||
assertThatCode(() ->
|
||||
new ExecOperation()
|
||||
.fromProject(new BaseProject())
|
||||
.command("echo")
|
||||
.workDir(FOO)
|
||||
.execute()).message().startsWith("Invalid work directory: ").endsWith(FOO);
|
||||
.execute()).message().startsWith("Invalid working directory: ").endsWith(FOO);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue