|
4 | 4 | import org.junit.Test;
|
5 | 5 |
|
6 | 6 | import static org.hamcrest.CoreMatchers.equalTo;
|
7 |
| -import static org.junit.Assert.*; |
| 7 | +import static org.junit.Assert.assertThat; |
8 | 8 | import static ru.lanwen.verbalregex.VerbalExpression.regex;
|
9 | 9 | import static ru.lanwen.verbalregex.matchers.TestMatchMatcher.matchesTo;
|
10 | 10 | import static ru.lanwen.verbalregex.matchers.TestsExactMatcher.matchesExactly;
|
@@ -107,15 +107,15 @@ public void unusualRegex() throws Exception {
|
107 | 107 | @Ignore("Planned in 1.3")
|
108 | 108 | public void captureWithName() throws Exception {
|
109 | 109 | }
|
110 |
| - |
| 110 | + |
111 | 111 | @Test
|
112 |
| - public void testStarWarsMovies() { |
113 |
| - VerbalExpression regex = VerbalExpression.regex() |
114 |
| - .find("Star Wars: ") |
115 |
| - .oneOf("The Phantom Menace", "Attack of the Clones", "Revenge of the Sith", |
116 |
| - "The Force Awakens", "A New Hope", "The Empire Strikes Back", "Return of the Jedi") |
117 |
| - .build(); |
118 |
| - assertTrue(regex.test("Star Wars: The Empire Strikes Back")); |
119 |
| - assertTrue(regex.test("Star Wars: Return of the Jedi")); |
| 112 | + public void oneOfShouldFindEpisodeTitleOfStarWarsMovies() { |
| 113 | + VerbalExpression regex = VerbalExpression.regex() |
| 114 | + .find("Star Wars: ") |
| 115 | + .oneOf("The Phantom Menace", "Attack of the Clones", "Revenge of the Sith", |
| 116 | + "The Force Awakens", "A New Hope", "The Empire Strikes Back", "Return of the Jedi") |
| 117 | + .build(); |
| 118 | + assertThat(regex, matchesTo("Star Wars: The Empire Strikes Back")); |
| 119 | + assertThat(regex, matchesTo("Star Wars: Return of the Jedi")); |
120 | 120 | }
|
121 | 121 | }
|
0 commit comments