Skip to content

Commit 3657b22

Browse files
author
joeretro
committed
Renamed stringContains to containsString
1 parent e6b1bfe commit 3657b22

5 files changed

Lines changed: 9 additions & 9 deletions

File tree

‎src/examples/org/hamcrest/examples/junit3/ExampleWithAssertThat.java‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
import static org.hamcrest.MatcherAssert.assertThat;
55
import static org.hamcrest.Matchers.isTwoXs;
66
import static org.hamcrest.core.IsNot.not;
7-
import static org.hamcrest.text.StringContains.stringContains;
7+
import static org.hamcrest.text.StringContains.containsString;
88

99
/**
1010
* Demonstrates how HamCrest matchers can be used with assertThat()
@@ -17,7 +17,7 @@ public class ExampleWithAssertThat extends TestCase {
1717
public void testUsingAssertThat() {
1818
assertThat("xx", isTwoXs());
1919
assertThat("yy", not(isTwoXs()));
20-
assertThat("i like cheese", stringContains("cheese"));
20+
assertThat("i like cheese", containsString("cheese"));
2121
}
2222

2323
}

‎src/examples/org/hamcrest/examples/junit4/ExampleWithAssertThat.java‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import static org.hamcrest.MatcherAssert.assertThat;
44
import static org.hamcrest.Matchers.isTwoXs;
55
import static org.hamcrest.core.IsNot.not;
6-
import static org.hamcrest.text.StringContains.stringContains;
6+
import static org.hamcrest.text.StringContains.containsString;
77
import org.junit.Test;
88

99
/**
@@ -18,7 +18,7 @@ public class ExampleWithAssertThat {
1818
public void usingAssertThat() {
1919
assertThat("xx", isTwoXs());
2020
assertThat("yy", not(isTwoXs()));
21-
assertThat("i like cheese", stringContains("cheese"));
21+
assertThat("i like cheese", containsString("cheese"));
2222
}
2323

2424
/**

‎src/examples/org/hamcrest/examples/testng/ExampleWithAssertThat.java‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import static org.hamcrest.MatcherAssert.assertThat;
44
import static org.hamcrest.Matchers.isTwoXs;
55
import static org.hamcrest.core.IsNot.not;
6-
import static org.hamcrest.text.StringContains.stringContains;
6+
import static org.hamcrest.text.StringContains.containsString;
77
import org.testng.annotations.Test;
88

99
/**
@@ -19,7 +19,7 @@ public class ExampleWithAssertThat {
1919
public void usingAssertThat() {
2020
assertThat("xx", isTwoXs());
2121
assertThat("yy", not(isTwoXs()));
22-
assertThat("i like cheese", stringContains("cheese"));
22+
assertThat("i like cheese", containsString("cheese"));
2323
}
2424

2525
}

‎src/library/org/hamcrest/text/StringContains.java‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ protected String relationship() {
2222
}
2323

2424
@Factory
25-
public static Matcher<String> stringContains(String substring) {
25+
public static Matcher<String> containsString(String substring) {
2626
return new StringContains(substring);
2727
}
2828

‎src/unit-test/org/hamcrest/text/StringContainsTest.java‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@
22
*/
33
package org.hamcrest.text;
44

5-
import static org.hamcrest.text.StringContains.stringContains;
5+
import static org.hamcrest.text.StringContains.containsString;
66
import org.hamcrest.AbstractMatcherTest;
77
import org.hamcrest.Matcher;
88

99

1010
public class StringContainsTest extends AbstractMatcherTest {
1111
static final String EXCERPT = "EXCERPT";
1212

13-
Matcher<String> stringContains = stringContains(EXCERPT);
13+
Matcher<String> stringContains = containsString(EXCERPT);
1414

1515
public void testEvaluatesToTrueIfArgumentContainsSpecifiedSubstring() {
1616
assertTrue("should be true if excerpt at beginning",

0 commit comments

Comments
 (0)