Fix deprecation warning in specs