Skip to content

Instantly share code, notes, and snippets.

@saiqulhaq
Last active January 6, 2024 07:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save saiqulhaq/efc2532a60c5f9bb4b77ba4e9e096f0b to your computer and use it in GitHub Desktop.
Save saiqulhaq/efc2532a60c5f9bb4b77ba4e9e096f0b to your computer and use it in GitHub Desktop.
Simplecov for Rails Engine with Minitest
# add this to your main library file
# lib/<engine_name>.rb
if ENV['RAILS_ENV'] == 'test'
require 'simplecov'
SimpleCov.start do
load_profile "test_frameworks"
add_filter %r{^/config/}
add_filter %r{^/db/}
add_group "Controllers", "app/controllers"
add_group "Channels", "app/channels"
add_group "Models", "app/models"
add_group "Mailers", "app/mailers"
add_group "Helpers", "app/helpers"
add_group "Jobs", %w[app/jobs app/workers]
add_group "DynamicLinks", "lib/"
end
end
# reference https://github.com/simplecov-ruby/simplecov/issues/434#issuecomment-228210164
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment