|
1 | 1 | package cucumber.runtime;
|
2 | 2 |
|
3 |
| -import net.sourceforge.cobertura.ant.Regex; |
4 |
| - |
5 | 3 | import org.junit.Test;
|
6 | 4 |
|
7 | 5 | import java.io.File;
|
@@ -67,49 +65,36 @@ public void default_strict() {
|
67 | 65 | }
|
68 | 66 |
|
69 | 67 | @Test
|
70 |
| - public void name() { |
71 |
| - String someName = "someName"; |
72 |
| - RuntimeOptions options = new RuntimeOptions(new Properties(), "--name", someName); |
| 68 | + public void name_without_spaces_is_preserved() { |
| 69 | + RuntimeOptions options = new RuntimeOptions(new Properties(), "--name", "someName"); |
73 | 70 | Pattern actualPattern = (Pattern) options.filters.iterator().next();
|
74 |
| - assertEquals(someName, actualPattern.pattern()); |
| 71 | + assertEquals("someName", actualPattern.pattern()); |
75 | 72 | }
|
76 |
| - |
| 73 | + |
77 | 74 | @Test
|
78 |
| - public void name_with_spaces() { |
79 |
| - String someName = "some Name"; |
80 |
| - RuntimeOptions options = new RuntimeOptions(new Properties(), "--name", someName); |
| 75 | + public void name_with_spaces_is_preserved() { |
| 76 | + RuntimeOptions options = new RuntimeOptions(new Properties(), "--name", "some Name"); |
81 | 77 | Pattern actualPattern = (Pattern) options.filters.iterator().next();
|
82 |
| - assertEquals(someName, actualPattern.pattern()); |
83 |
| - } |
84 |
| - |
| 78 | + assertEquals("some Name", actualPattern.pattern()); |
| 79 | + } |
| 80 | + |
85 | 81 | @Test
|
86 | 82 | public void ensure_name_with_spaces_works_with_cucumber_options() {
|
87 |
| - String someName = "some Name"; |
88 | 83 | Properties properties = new Properties();
|
89 |
| - properties.setProperty("cucumber.options", "--name '" + someName + "'"); |
| 84 | + properties.setProperty("cucumber.options", "--name 'some Name'"); |
90 | 85 | RuntimeOptions options = new RuntimeOptions(properties);
|
91 | 86 | Pattern actualPattern = (Pattern) options.filters.iterator().next();
|
92 |
| - assertEquals(someName, actualPattern.pattern()); |
| 87 | + assertEquals("some Name", actualPattern.pattern()); |
93 | 88 | }
|
94 |
| - |
| 89 | + |
95 | 90 | @Test
|
96 | 91 | public void ensure_multiple_cucumber_options_with_spaces_parse_correctly() {
|
97 |
| - String someName = "some Name"; |
98 |
| - String somePath = "some file\\path"; |
99 | 92 | Properties properties = new Properties();
|
100 |
| - properties.setProperty("cucumber.options", "--name '" + someName + "'" + " --dotcucumber '" + somePath + "'"); |
| 93 | + properties.setProperty("cucumber.options", "--name 'some Name' --dotcucumber 'some file\\path'"); |
101 | 94 | RuntimeOptions options = new RuntimeOptions(properties);
|
102 | 95 | Pattern actualPattern = (Pattern) options.filters.iterator().next();
|
103 |
| - assertEquals(someName, actualPattern.pattern()); |
104 |
| - assertEquals(new File(somePath), options.dotCucumber); |
105 |
| - } |
106 |
| - |
107 |
| - @Test |
108 |
| - public void name_short() { |
109 |
| - String someName = "someName"; |
110 |
| - RuntimeOptions options = new RuntimeOptions(new Properties(), "-n", someName); |
111 |
| - Pattern actualPattern = (Pattern) options.filters.iterator().next(); |
112 |
| - assertEquals(someName, actualPattern.pattern()); |
| 96 | + assertEquals("some Name", actualPattern.pattern()); |
| 97 | + assertEquals(new File("some file\\path"), options.dotCucumber); |
113 | 98 | }
|
114 | 99 |
|
115 | 100 | @Test
|
|
0 commit comments