Add utils specs, simplify getGlobPattern to accept RegExp