Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Invalid url caused fileName duplication
Issue #cucumber-reports-plugin/issues/116
- Loading branch information
1 parent
7dee9e9
commit 76f9294
Showing
5 changed files
with
51 additions
and
6 deletions.
There are no files selected for viewing
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
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
6 changes: 4 additions & 2 deletions
6
src/test/java/net/masterthought/cucumber/util/CounterTest.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
43 changes: 43 additions & 0 deletions
43
src/test/java/net/masterthought/cucumber/util/UtilTest.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,43 @@ | ||
package net.masterthought.cucumber.util; | ||
|
||
import static org.assertj.core.api.Assertions.assertThat; | ||
|
||
import java.util.Arrays; | ||
import java.util.Collection; | ||
|
||
import org.junit.Test; | ||
import org.junit.runner.RunWith; | ||
import org.junit.runners.Parameterized; | ||
|
||
/** | ||
* @author Damian Szczepanik (damianszczepanik@github) | ||
*/ | ||
@RunWith(Parameterized.class) | ||
public class UtilTest { | ||
|
||
@Parameterized.Parameters | ||
public static Collection<Object[]> data() { | ||
return Arrays.asList(new Object[][]{ | ||
{"simpleFile", "simpleFile"}, | ||
{"file-dash", "file-dash"}, | ||
{"東京", "-u6771-u4EAC"}, | ||
{"żółć", "-u017C-u00F3-u0142-u0107"} | ||
}); | ||
} | ||
|
||
@Parameterized.Parameter(value = 0) | ||
public String value; | ||
|
||
@Parameterized.Parameter(value = 1) | ||
public String fileName; | ||
|
||
@Test | ||
public void toValidFileName_RemovesInvalidChars() { | ||
|
||
// when | ||
String convertedFileName = Util.toValidFileName(value); | ||
|
||
// then | ||
assertThat(convertedFileName).isEqualTo(fileName); | ||
} | ||
} |
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