0

I am working on a Rails project that has some older code, but I only want to see the coverage of the controllers that I am working on. For example, the structure will be:

controllers/
  api/
  whatever1/
  whatever2/
  a_controller.rb
  b_controller.rb

I only want to see the coverage for controllers/api/. I know about the add_filter method from Simplecov, but adding each one of them would mean a lot of work.

Is there any way to maybe include a regex or some conditional to add filter for everything except the controllers/api folder?

Victor Motogna
  • 731
  • 1
  • 12
  • 22

1 Answers1

0

In your case the best way is to create a new group for the new controllers like that:

SimpleCov.start 'rails' do
  add_group "API Controllers", "app/controllers/api"
  #...
end
  • I think that's the way I'll end up going. I also wanted to run only this specific folder, as there are lots of tests that I can ignore and not wait for them to finish – Victor Motogna Nov 09 '22 at 10:27