Knows Not Much Knows Not Much - 3 months ago 33
Scala Question

What does "^^" mean in Scala library specs2

I came across this line of code today

def beCapitalizedAs(capitalized: String) = be_==(capitalized) ^^

I don't know what "^^" means. I also googled but couldn't find anything.


It is defined on the specs2 Matcher trait and is meant to adapt one matcher to another.

This means you can change the actual value before doing the match, i.e. in your example beCapitalizedAs will do the comparison on a capitalized String before match.

Also see the specs Matchers guide for further information.