Element#as raises UnsupportedPattern when appropriate