Ruby's Test::Unit
has a nice assert_matches
method that can be used in unit tests to assert that a regex matches a string.
Is there anything like this in JUnit? Currently, I do this:
assertEquals(true, actual.matches(expectedRegex));
See Question&Answers more detail:os