Skip to content

Instantly share code, notes, and snippets.

@v-kolesnikov
Created January 29, 2023 11:34
Show Gist options
  • Save v-kolesnikov/b9e9ae5690c80cebdbf6057942218cb8 to your computer and use it in GitHub Desktop.
Save v-kolesnikov/b9e9ae5690c80cebdbf6057942218cb8 to your computer and use it in GitHub Desktop.
Coverage groups
# https://github.com/jeremyevans/forme/blob/master/spec/forme_coverage.rb
require 'coverage'
require 'simplecov'
def SimpleCov.forme_coverage(opts = {})
start do
enable_coverage :branch
add_filter "/spec/"
add_group('Missing'){|src| src.covered_percent < 100}
add_group('Covered'){|src| src.covered_percent == 100}
yield self if block_given?
end
end
ENV.delete('COVERAGE')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment