Run a test suite with coverage using `simplecov run`
mainIf your project does not have a test_helper.rb hook calling SimpleCov.start, you can use simplecov run to execute your test command with SimpleCov pre-loaded. This sets RUBYOPT=-rsimplecov/autostart for the process and all its subprocesses (like parallel workers). If a .simplecov config already exists, the autostart shim will defer to it and avoid double-starting.
$ simplecov run bundle exec rspec
$ simplecov run -- bundle exec rake test
$ simplecov run ruby my_test.rb