Remove deprecation warning in spec test