Skip to content

Commit

Permalink
Merge pull request #566 from Ivruix/test-all-filters
Browse files Browse the repository at this point in the history
Extend the App.java test
  • Loading branch information
yegor256 authored Jan 22, 2025
2 parents 9810029 + cc97eaf commit 57fd2c6
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions src/test/java/org/jpeek/AppTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,40 @@ void canIncludePrivateMethods(@TempDir final Path output) throws Exception {
).affirm();
}

@Test
void canIncludeConstructors(@TempDir final Path output) throws Exception {
final Path input = Paths.get(".");
final Map<String, Object> args = new HashMap<>();
args.put("include-ctors", 1);
new App(input, output, args).analyze();
new Assertion<>(
"Must contain constructor",
XhtmlMatchers.xhtml(
new TextOf(output.resolve("skeleton.xml")).asString()
),
XhtmlMatchers.hasXPaths(
"//method[@ctor='true']"
)
).affirm();
}

@Test
void canIncludeStaticMethods(@TempDir final Path output) throws Exception {
final Path input = Paths.get(".");
final Map<String, Object> args = new HashMap<>();
args.put("include-static-methods", 1);
new App(input, output, args).analyze();
new Assertion<>(
"Must contain static method",
XhtmlMatchers.xhtml(
new TextOf(output.resolve("skeleton.xml")).asString()
),
XhtmlMatchers.hasXPaths(
"//method[@static='true']"
)
).affirm();
}

@Test
void createsIndexHtml(@TempDir final Path output) throws IOException {
final Path input = Paths.get(".");
Expand Down

0 comments on commit 57fd2c6

Please sign in to comment.