Skip to content

Commit

Permalink
#358 tests
Browse files Browse the repository at this point in the history
  • Loading branch information
yegor256 committed Oct 5, 2021
1 parent 6c2bfd3 commit db3470b
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
2 changes: 2 additions & 0 deletions eo-maven-plugin/src/it/fibonacci/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ SOFTWARE.
<goal>assemble</goal>
<goal>compile</goal>
<goal>resolve</goal>
<goal>copy-sources</goal>
<goal>prepack</goal>
</goals>
</execution>
</executions>
Expand Down
6 changes: 3 additions & 3 deletions eo-maven-plugin/src/main/java/org/eolang/maven/CopyMojo.java
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,9 @@ public void execute() throws MojoFailureException {
src -> {
try {
new Save(
CopyMojo.REPLACE.matcher(new TextOf(new InputOf(src)).asString()).replaceAll(
String.format("\1:%s\2", this.version)
),
CopyMojo.REPLACE
.matcher(new TextOf(new InputOf(src)).asString())
.replaceAll(String.format("\1:%s\2", this.version)),
this.classesDir.toPath().resolve("EO-SOURCES").resolve(
src.toAbsolutePath().toString().substring(
this.sourcesDir.toPath().toAbsolutePath().toString().length() + 1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,11 @@ public void copiesSources(@TempDir final Path temp) throws Exception {
"+rt foo:0.0.0\n\n[args] > main\n \"0.0.0\" > @\n",
src.resolve("foo/main.eo")
).save();
final String ver = "1.1.1";
new Moja<>(CopyMojo.class)
.with("sourcesDir", src.toFile())
.with("classesDir", classes.toFile())
.with("version", "1.1.1")
.with("version", ver)
.execute();
final Path out = classes.resolve("EO-SOURCES/foo/main.eo");
MatcherAssert.assertThat(
Expand All @@ -61,7 +62,7 @@ public void copiesSources(@TempDir final Path temp) throws Exception {
new String(Files.readAllBytes(out), StandardCharsets.UTF_8),
Matchers.allOf(
Matchers.containsString("0.0.0"),
Matchers.containsString("1.1.1")
Matchers.containsString(ver)
)
);
}
Expand Down

0 comments on commit db3470b

Please sign in to comment.