Cleaned up API to match bld operations aand options APIs
This commit is contained in:
parent
46b9a52215
commit
eabca28d38
6 changed files with 56 additions and 6 deletions
|
@ -91,17 +91,16 @@ class GeneratedVersionTest {
|
|||
gv.setClassName("MyVersion");
|
||||
|
||||
var t = gv.buildTemplate();
|
||||
//noinspection TrailingWhitespacesInTextBlock
|
||||
assertThat(t.getContent()).isEqualTo("""
|
||||
package com.example.my;
|
||||
|
||||
|
||||
public final class MyVersion {
|
||||
public static final int PROJECT = "My App";
|
||||
public static final int MAJOR = 2;
|
||||
public static final int MINOR = 1;
|
||||
public static final int REVISION = 3;
|
||||
public static final String QUALIFIER = "";
|
||||
|
||||
|
||||
private MyVersion() {
|
||||
// no-op
|
||||
}
|
||||
|
@ -127,6 +126,21 @@ class GeneratedVersionTest {
|
|||
.contains("private GeneratedVersion");
|
||||
}
|
||||
|
||||
@Test
|
||||
void testDirectories() {
|
||||
var foo = new File("foo");
|
||||
var bar = new File("bar");
|
||||
|
||||
var op = new GeneratedVersionOperation().directory(foo);
|
||||
assertThat(op.generatedVersion().getDirectory()).as("as file").isEqualTo(foo);
|
||||
|
||||
op = op.directory(bar.toPath());
|
||||
assertThat(op.generatedVersion().getDirectory()).as("as path").isEqualTo(bar);
|
||||
|
||||
op = op.directory("foo");
|
||||
assertThat(op.generatedVersion().getDirectory()).as("as string").isEqualTo(foo);
|
||||
}
|
||||
|
||||
@Test
|
||||
void testExample() throws Exception {
|
||||
var tmpDir = Files.createTempDirectory("bld-generated-version-example-").toFile();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue