Ah, thank your for clearing that up. My RAILS_ENV was set to development, so the tests were running in development mode, too. After unsetting that, it uses the test environment by default. If one wants to enforce a test environment for the tests, they can run this:
RAILS_ENV=test bundle exec rake plugin:spec["my-plugin-dir"]