除了之前介绍的Spec2内置的Matcher, 针对不同的功能,Spec2还提供了一些可选的Matcher,比如:
Result
如果你需要其它Matcher的结果:
// you need to extend the ResultMatchers trait
class MatchersSpec extends Specification with matcher.ResultMatchers { def is =
"beMatching is using a regexp" ! {
("Hello" must beMatching("h.*")) must beSuccessful
}
}