Skip to content

Commit

Permalink
tidying tests
Browse files Browse the repository at this point in the history
  • Loading branch information
sf105 committed May 28, 2014
1 parent ba93251 commit 5466739
Showing 1 changed file with 9 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,25 +17,15 @@ protected Matcher<?> createMatcher() {
return stringStartsWith;
}

public void testEvaluatesToTrueIfArgumentContainsSpecifiedSubstring() {
assertTrue("should be true if excerpt at beginning",
stringStartsWith.matches(EXCERPT + "END"));
assertFalse("should be false if excerpt at end",
stringStartsWith.matches("START" + EXCERPT));
assertFalse("should be false if excerpt in middle",
stringStartsWith.matches("START" + EXCERPT + "END"));
assertTrue("should be true if excerpt is at beginning and repeated",
stringStartsWith.matches(EXCERPT + EXCERPT));

assertFalse("should be false if excerpt is not in string",
stringStartsWith.matches("Something else"));
assertFalse("should be false if part of excerpt is at start of string",
stringStartsWith.matches(EXCERPT.substring(1)));
}

public void testEvaluatesToTrueIfArgumentIsEqualToSubstring() {
assertTrue("should be true if excerpt is entire string",
stringStartsWith.matches(EXCERPT));
public void testMatchesStringAtStart() {
assertMatches(stringStartsWith, EXCERPT + "END");
assertDoesNotMatch(stringStartsWith, "START" + EXCERPT);
assertDoesNotMatch(stringStartsWith, "START" + EXCERPT + "END");
assertMatches(stringStartsWith, EXCERPT);
assertMatches(stringStartsWith, EXCERPT + EXCERPT);
assertDoesNotMatch(stringStartsWith, "EXCER");

assertMismatchDescription("was \"Something else\"", stringStartsWith, "Something else");
}

public void testHasAReadableDescription() {
Expand Down

0 comments on commit 5466739

Please sign in to comment.