forked from commonmark/commonmark-java
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSpecTestCase.java
More file actions
31 lines (24 loc) · 836 Bytes
/
SpecTestCase.java
File metadata and controls
31 lines (24 loc) · 836 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
package org.commonmark.testutil;
import org.commonmark.testutil.example.Example;
import org.commonmark.testutil.example.ExampleReader;
import org.junit.runner.RunWith;
import org.junit.runners.Parameterized;
import org.junit.runners.Parameterized.Parameters;
import java.util.ArrayList;
import java.util.List;
@RunWith(Parameterized.class)
public abstract class SpecTestCase {
protected final Example example;
public SpecTestCase(Example example) {
this.example = example;
}
@Parameters(name = "{0}")
public static List<Object[]> data() {
List<Example> examples = ExampleReader.readExamples(TestResources.getSpec());
List<Object[]> data = new ArrayList<>();
for (Example example : examples) {
data.add(new Object[]{example});
}
return data;
}
}