Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Decoupled large part of Mockito from hamcrest
- Massive commit, sorry about this. - Majority of the classes are now decoupled from hamcrest see (#154) - Many TODOs are pending, specifically Mockito no longer supports hamcrest matchers which is not desired
- Loading branch information
1 parent
d7436bd
commit 7f20e63
Showing
59 changed files
with
352 additions
and
432 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
package org.mockito; | ||
|
||
import org.mockito.internal.util.Decamelizer; | ||
|
||
/** | ||
* Matcher of arguments, decoupled from hamcrest. | ||
*/ | ||
public abstract class MockitoMatcher<T> { | ||
|
||
/** | ||
* Informs if this matcher accepts the given argument. | ||
* <p> | ||
* The method should <b>never</b> assert if the argument doesn't match. It | ||
* should only return false. | ||
* | ||
* @param argument | ||
* the argument | ||
* @return true if this matcher accepts the given argument. | ||
*/ | ||
public abstract boolean matches(Object argument); | ||
|
||
/** | ||
* By default this method decamelizes class name to promote meaningful names for matcher classes. | ||
* <p> | ||
* For example <b>StringWithStrongLanguage</b> matcher will generate 'String with strong language' description in case of failure. | ||
* <p> | ||
* You might want to override this method to | ||
* provide more specific description of the matcher (useful when | ||
* verification failures are reported). | ||
*/ | ||
public String describe() { | ||
String className = getClass().getSimpleName(); | ||
return Decamelizer.decamelizeMatcher(className); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.