|
2 | 2 |
|
3 | 3 | import gherkin.formatter.Reporter;
|
4 | 4 | import gherkin.formatter.model.Result;
|
| 5 | +import gherkin.formatter.model.Tag; |
5 | 6 | import org.junit.Test;
|
6 | 7 |
|
| 8 | +import java.util.Collections; |
| 9 | + |
7 | 10 | import static org.junit.Assert.assertEquals;
|
8 | 11 | import static org.mockito.Mockito.mock;
|
9 | 12 | import static org.mockito.Mockito.verify;
|
10 | 13 |
|
11 | 14 | public class ScenarioResultTest {
|
12 | 15 |
|
13 | 16 | private Reporter reporter = mock(Reporter.class);
|
14 |
| - private ScenarioImpl r = new ScenarioImpl(reporter); |
| 17 | + private ScenarioImpl s = new ScenarioImpl(reporter, Collections.<Tag>emptySet()); |
15 | 18 |
|
16 | 19 | @Test
|
17 | 20 | public void no_steps_is_passed() throws Exception {
|
18 |
| - assertEquals("passed", r.getStatus()); |
| 21 | + assertEquals("passed", s.getStatus()); |
19 | 22 | }
|
20 | 23 |
|
21 | 24 | @Test
|
22 | 25 | public void passed_and_failed_is_passed() throws Exception {
|
23 |
| - r.add(new Result("passed", 0L, null, null)); |
24 |
| - r.add(new Result("failed", 0L, null, null)); |
25 |
| - assertEquals("failed", r.getStatus()); |
| 26 | + s.add(new Result("passed", 0L, null, null)); |
| 27 | + s.add(new Result("failed", 0L, null, null)); |
| 28 | + assertEquals("failed", s.getStatus()); |
26 | 29 | }
|
27 | 30 |
|
28 | 31 | @Test
|
29 | 32 | public void passed_and_skipped_is_skipped_although_we_cant_have_skipped_without_undefined_or_pending() throws Exception {
|
30 |
| - r.add(new Result("passed", 0L, null, null)); |
31 |
| - r.add(new Result("skipped", 0L, null, null)); |
32 |
| - assertEquals("skipped", r.getStatus()); |
| 33 | + s.add(new Result("passed", 0L, null, null)); |
| 34 | + s.add(new Result("skipped", 0L, null, null)); |
| 35 | + assertEquals("skipped", s.getStatus()); |
33 | 36 | }
|
34 | 37 |
|
35 | 38 | @Test
|
36 | 39 | public void undefined_and_pending_is_pending() throws Exception {
|
37 |
| - r.add(new Result("undefined", 0L, null, null)); |
38 |
| - r.add(new Result("pending", 0L, null, null)); |
39 |
| - assertEquals("pending", r.getStatus()); |
| 40 | + s.add(new Result("undefined", 0L, null, null)); |
| 41 | + s.add(new Result("pending", 0L, null, null)); |
| 42 | + assertEquals("pending", s.getStatus()); |
40 | 43 | }
|
41 | 44 |
|
42 | 45 | @Test
|
43 | 46 | public void embeds_data() {
|
44 | 47 | byte[] data = new byte[]{1, 2, 3};
|
45 |
| - r.embed(data, "bytes/foo"); |
| 48 | + s.embed(data, "bytes/foo"); |
46 | 49 | verify(reporter).embedding("bytes/foo", data);
|
47 | 50 | }
|
48 | 51 |
|
49 | 52 | @Test
|
50 | 53 | public void prints_output() {
|
51 |
| - r.write("Hi"); |
| 54 | + s.write("Hi"); |
52 | 55 | verify(reporter).write("Hi");
|
53 | 56 | }
|
54 | 57 | }
|
0 commit comments