Skip to content

Commit 2380e38

Browse files
committed
d markdown table
1 parent b882081 commit 2380e38

File tree

2 files changed

+18
-1
lines changed

2 files changed

+18
-1
lines changed

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,11 @@ public class TableTest
99
@Test
1010
void abilityModifier()
1111
{
12-
Approvals.verify(MarkdownTable.create(Range.get(1, 20), a -> getModifier(a), "Score", "Modifier"));
12+
// begin-snippet: markdown_table_example
13+
Integer[] inputs = Range.get(1, 20);
14+
MarkdownTable table = MarkdownTable.create(inputs, a -> getModifier(a), "Score", "Modifier");
15+
Approvals.verify(table);
16+
// end-snippet
1317
}
1418
private Integer getModifier(Integer ability)
1519
{

approvaltests/docs/how_to/TestAVarietyOfValues.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,19 @@ placeholder input.value2
4848
5. Change the TITLE to something meaningful
4949
6. Run it, and approve the output.
5050

51+
52+
## Tables
53+
54+
Another way to test a variety of inputs is to use a `MarkdownTable`.
55+
Here's an example:
56+
57+
snippet: markdown_table_example
58+
59+
which will produce:
60+
61+
include: TableTest.abilityModifier.approved.md
62+
63+
5164
---
5265

5366
[Back to User Guide](/doc/README.md#top)

0 commit comments

Comments
 (0)