simplecov
https://github.com/simplecov-ruby/simplecov
Ruby
Code coverage for Ruby with a powerful configuration library and automatic merging of coverage across test suites
SimpleCov::Configuration#add_filter
Add a filter to the processing chain.
There are three ways to define a filter:
* as a String that will then be matched against all source files' file paths,
SimpleCov.add_filter 'app/models' # will reject all your models
* as a block which will be passed the source file in question and should either
return a true or false value, depending on whether the file should be removed
SimpleCov.add_filter do |src_file|
File.basename(src_file.filename) == 'environment.rb'
end # Will exclude environment.rb files from the results
* as an instance of a subclass of SimpleCov::Filter. See the documentation there
on how to define your own filter classesEdit
git clone [email protected]:simplecov-ruby/simplecov.git
cd simplecov
open sig/simplecov.rbs
Contribute
# Make a new branchgit checkout -b -your-name--update-docs-SimpleCov--Configuration-add_filter-for-pr
# Commit to gitgit add sig/simplecov.rbsgit commit -m "better docs for SimpleCov::Configuration#add_filter"
# Open pull requestgem install hub # on a mac you can `brew install hub`
hub fork
git push <your name> -your-name--update-docs-SimpleCov--Configuration-add_filter-for-pr
hub pull-request
# Celebrate!