Skip to content

Clarify relation between track_files and add_filter #610

Open
@cbeer

Description

@cbeer

I was surprised recently, when I tried to filter out a particular file from coverage analysis that this usage [1]:

SimpleCov.start do
  add_filter 'lib/some/file/to/ignore.rb'

  track_files '{app,lib}/**/*'

results in a coverage report that says lib/some/file/to/ignore.rb has 0% coverage. I expected that add_filter would remove the file entirely from the report. I'm probably going to change my code to a slightly uglier track_files, but I wonder if there is or should be a cleaner way to do this.

[1] In reality, I'm using SimpleCov.start('rails') and was surprised that my filters weren't being applied.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions