forked from cucumber-attic/gherkin2
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added a unit test to show the problem
- Loading branch information
Showing
1 changed file
with
36 additions
and
0 deletions.
There are no files selected for viewing
36 changes: 36 additions & 0 deletions
36
java/src/test/java/gherkin/formatter/FilterFormatterTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
package gherkin.formatter; | ||
|
||
import java.util.ArrayList; | ||
import java.util.Arrays; | ||
import java.util.Collections; | ||
|
||
import org.junit.Test; | ||
|
||
import gherkin.formatter.model.Examples; | ||
import gherkin.formatter.model.Tag; | ||
|
||
import static org.junit.Assert.assertEquals; | ||
import static org.mockito.Mockito.mock; | ||
|
||
public class FilterFormatterTest { | ||
|
||
@Test | ||
public void filterFormatterShouldNotClearExampleTags() { | ||
|
||
FilterFormatter filterFormatter = new FilterFormatter(mock(Formatter.class), Arrays.asList("@filter")); | ||
|
||
final ArrayList<Tag> originalTags = new ArrayList<Tag>(); | ||
originalTags.add(new Tag("@tag", 0)); | ||
|
||
Examples examples1 = new Examples(Collections.EMPTY_LIST, new ArrayList<Tag>(originalTags), | ||
"keyword1", "name1", "description1", 0, "id1", Collections.EMPTY_LIST); | ||
Examples examples2 = new Examples(Collections.EMPTY_LIST, new ArrayList<Tag>(originalTags), | ||
"keyword2", "name2", "description2", 0, "id2", Collections.EMPTY_LIST); | ||
|
||
filterFormatter.examples(examples1); | ||
filterFormatter.examples(examples2); | ||
|
||
assertEquals("Example tags should not be modified", originalTags, examples1.getTags()); | ||
assertEquals("Example tags should not be modified", originalTags, examples2.getTags()); | ||
} | ||
} |