Skip to content

Commit 612f05d

Browse files
committed
R Clean up MarkdownTable class wrapping
1 parent 407912c commit 612f05d

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

approvaltests-tests/src/test/java/org/approvaltests/TableTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@ void differentCases()
1919
{
2020
// begin-snippet: markdown_table_example
2121
String[] inputs = {"verify json", "verify all", "verify parameters", "verify as json"};
22-
MarkdownTableBasic table = MarkdownTableBasic.withHeaders("Input", "Camel Case", "Snake Case", "Kebab Case");
22+
MarkdownTable table = MarkdownTable.withHeaders("Input", "Camel Case", "Snake Case", "Kebab Case");
2323
table.addRowsForInputs(inputs, this::toCamelCase, this::toSnakeCase, this::toKebabCase);
24-
Approvals.verify(new MarkdownTable(table));
24+
Approvals.verify(table);
2525
// end-snippet
2626
}
2727
private String toKebabCase(String input)

approvaltests/src/main/java/org/approvaltests/utils/MarkdownTable.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@ public static <I, O> MarkdownTable create(I[] inputs, Function1<I, O> o, String
1818
{
1919
return new MarkdownTable(MarkdownTableBasic.create(inputs, o, column1, column2));
2020
}
21+
public static MarkdownTable withHeaders(String... columnNames) {
22+
return new MarkdownTable(MarkdownTableBasic.withHeaders(columnNames));
23+
}
2124
@Override
2225
public VerifyParameters getVerifyParameters(Options options)
2326
{

0 commit comments

Comments
 (0)