As @dbugger in the comments helped me realize, I updated rspec from 5.0.3 to 7.0.1 and that solved the issue.