Skip to content

Commit cd4ef28

Browse files
author
joeretro
committed
Renamed same() -> sameInstance()
1 parent d3be762 commit cd4ef28

2 files changed

Lines changed: 7 additions & 7 deletions

File tree

‎src/library/org/hamcrest/core/IsSame.java‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ public void describeTo(Description description) {
3333
* this object.
3434
*/
3535
@Factory
36-
public static <T> Matcher<T> same(T object) {
36+
public static <T> Matcher<T> sameInstance(T object) {
3737
return new IsSame<T>(object);
3838
}
3939

‎src/unit-test/org/hamcrest/core/IsSameTest.java‎

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

5-
import static org.hamcrest.core.IsSame.same;
5+
import static org.hamcrest.core.IsSame.sameInstance;
66
import static org.hamcrest.core.IsNot.not;
77
import org.hamcrest.AbstractMatcherTest;
88
import org.hamcrest.Matcher;
@@ -12,22 +12,22 @@
1212
public class IsSameTest extends AbstractMatcherTest {
1313

1414
protected Matcher<?> createMatcher() {
15-
return same("irrelevant");
15+
return sameInstance("irrelevant");
1616
}
1717

1818
public void testEvaluatesToTrueIfArgumentIsReferenceToASpecifiedObject() {
1919
Object o1 = new Object();
2020
Object o2 = new Object();
2121

22-
assertThat(o1, same(o1));
23-
assertThat(o2, not(same(o1)));
22+
assertThat(o1, sameInstance(o1));
23+
assertThat(o2, not(sameInstance(o1)));
2424
}
2525

2626
public void testReturnsReadableDescriptionFromToString() {
27-
assertDescription("same(\"ARG\")", same("ARG"));
27+
assertDescription("same(\"ARG\")", sameInstance("ARG"));
2828
}
2929

3030
public void testReturnsReadableDescriptionFromToStringWhenInitialisedWithNull() {
31-
assertDescription("same(null)", same(null));
31+
assertDescription("same(null)", sameInstance(null));
3232
}
3333
}

0 commit comments

Comments
 (0)