There may come a time when you don’t want to run all of your tests together. A common example is wanting to split out running slow integration tests and unit test. On one of my projects we needed a separate set of tests to run at intervals just to make sure some of the numbers were within safe bounds, so we had to set up completely separate tests. This involved setting up a different spec_helper configuration for the different set of tests. Here, I will do a quick walkthrough of how to set up and run those tests.
require "separate_verification"at the top of your spec files.
rspec -I separate_verification/ separate_verification/
And that’s it!
Note that it is advisable to also create a separate test environment for your tests (in my example, you would create a separate 'separate_verification' environment) if you’re messing around with specific data. It would be safe so that there aren’t any unexpected side-effects due to leftover data when running your regular specs.