Fix deprecation warning when running specs