Skip to content

Commit 8d59494

Browse files
author
MerkushevKirill
committed
rft - rename test and add issue #32 mention
1 parent 9828065 commit 8d59494

File tree

2 files changed

+13
-10
lines changed

2 files changed

+13
-10
lines changed

src/main/java/ru/lanwen/verbalregex/VerbalExpression.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -533,6 +533,8 @@ public Builder atLeast(final int from) {
533533
/**
534534
* Add a alternative expression to be matched
535535
*
536+
* Issue #32
537+
*
536538
* @param pValue - the string to be looked for
537539
* @return this builder
538540
*/
@@ -559,6 +561,7 @@ public Builder or(final String pValue) {
559561
*
560562
* @param pValues - the strings to be looked for
561563
* @return this builder
564+
* @since 1.3
562565
*/
563566
public Builder oneOf(final String... pValues) {
564567
if(pValues != null && pValues.length > 0) {

src/test/java/ru/lanwen/verbalregex/RealWorldUnitTest.java

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
import org.junit.Test;
55

66
import static org.hamcrest.CoreMatchers.equalTo;
7-
import static org.junit.Assert.*;
7+
import static org.junit.Assert.assertThat;
88
import static ru.lanwen.verbalregex.VerbalExpression.regex;
99
import static ru.lanwen.verbalregex.matchers.TestMatchMatcher.matchesTo;
1010
import static ru.lanwen.verbalregex.matchers.TestsExactMatcher.matchesExactly;
@@ -107,15 +107,15 @@ public void unusualRegex() throws Exception {
107107
@Ignore("Planned in 1.3")
108108
public void captureWithName() throws Exception {
109109
}
110-
110+
111111
@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"));
120120
}
121121
}

0 commit comments

Comments
 (0)