rails-rfc6570 3.2.0 → 3.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +9 -1
- data/lib/rails/rfc6570/version.rb +1 -1
- data/rails-rfc6570.gemspec +1 -1
- data/spec/dummy/log/test.log +432 -0
- metadata +10 -262
- data/vendor/bundle/ruby/3.3.0/bundler/gems/rubocop-config-943facea9d8f/LICENSE +0 -21
- data/vendor/bundle/ruby/3.3.0/bundler/gems/rubocop-config-943facea9d8f/README.md +0 -23
- data/vendor/bundle/ruby/3.3.0/bundler/gems/rubocop-config-943facea9d8f/rubocop-config.gemspec +0 -31
- data/vendor/bundle/ruby/3.3.0/gems/actionpack-7.2.1/CHANGELOG.md +0 -154
- data/vendor/bundle/ruby/3.3.0/gems/actionpack-7.2.1/MIT-LICENSE +0 -21
- data/vendor/bundle/ruby/3.3.0/gems/actionpack-7.2.1/README.rdoc +0 -57
- data/vendor/bundle/ruby/3.3.0/gems/actionview-7.2.1/CHANGELOG.md +0 -113
- data/vendor/bundle/ruby/3.3.0/gems/actionview-7.2.1/MIT-LICENSE +0 -21
- data/vendor/bundle/ruby/3.3.0/gems/actionview-7.2.1/README.rdoc +0 -40
- data/vendor/bundle/ruby/3.3.0/gems/activesupport-7.2.1/CHANGELOG.md +0 -258
- data/vendor/bundle/ruby/3.3.0/gems/activesupport-7.2.1/MIT-LICENSE +0 -20
- data/vendor/bundle/ruby/3.3.0/gems/activesupport-7.2.1/README.rdoc +0 -40
- data/vendor/bundle/ruby/3.3.0/gems/addressable-2.8.7/CHANGELOG.md +0 -301
- data/vendor/bundle/ruby/3.3.0/gems/addressable-2.8.7/LICENSE.txt +0 -202
- data/vendor/bundle/ruby/3.3.0/gems/addressable-2.8.7/README.md +0 -121
- data/vendor/bundle/ruby/3.3.0/gems/addressable-2.8.7/addressable.gemspec +0 -28
- data/vendor/bundle/ruby/3.3.0/gems/appraisal-2.5.0/MIT-LICENSE +0 -21
- data/vendor/bundle/ruby/3.3.0/gems/appraisal-2.5.0/README.md +0 -243
- data/vendor/bundle/ruby/3.3.0/gems/appraisal-2.5.0/appraisal.gemspec +0 -29
- data/vendor/bundle/ruby/3.3.0/gems/ast-2.4.2/LICENSE.MIT +0 -20
- data/vendor/bundle/ruby/3.3.0/gems/ast-2.4.2/README.YARD.md +0 -12
- data/vendor/bundle/ruby/3.3.0/gems/benchmark-ips-2.13.0/LICENSE +0 -20
- data/vendor/bundle/ruby/3.3.0/gems/benchmark-ips-2.13.0/README.md +0 -279
- data/vendor/bundle/ruby/3.3.0/gems/bigdecimal-3.1.8/LICENSE +0 -56
- data/vendor/bundle/ruby/3.3.0/gems/bigdecimal-3.1.8/bigdecimal.gemspec +0 -57
- data/vendor/bundle/ruby/3.3.0/gems/builder-3.3.0/MIT-LICENSE +0 -20
- data/vendor/bundle/ruby/3.3.0/gems/builder-3.3.0/README.md +0 -258
- data/vendor/bundle/ruby/3.3.0/gems/builder-3.3.0/builder.gemspec +0 -49
- data/vendor/bundle/ruby/3.3.0/gems/byebug-11.1.3/CHANGELOG.md +0 -934
- data/vendor/bundle/ruby/3.3.0/gems/byebug-11.1.3/LICENSE +0 -23
- data/vendor/bundle/ruby/3.3.0/gems/byebug-11.1.3/README.md +0 -199
- data/vendor/bundle/ruby/3.3.0/gems/coderay-1.1.3/MIT-LICENSE +0 -22
- data/vendor/bundle/ruby/3.3.0/gems/coderay-1.1.3/README_INDEX.rdoc +0 -123
- data/vendor/bundle/ruby/3.3.0/gems/concurrent-ruby-1.3.4/CHANGELOG.md +0 -593
- data/vendor/bundle/ruby/3.3.0/gems/concurrent-ruby-1.3.4/LICENSE.txt +0 -21
- data/vendor/bundle/ruby/3.3.0/gems/concurrent-ruby-1.3.4/README.md +0 -407
- data/vendor/bundle/ruby/3.3.0/gems/connection_pool-2.4.1/LICENSE +0 -20
- data/vendor/bundle/ruby/3.3.0/gems/connection_pool-2.4.1/README.md +0 -135
- data/vendor/bundle/ruby/3.3.0/gems/connection_pool-2.4.1/connection_pool.gemspec +0 -24
- data/vendor/bundle/ruby/3.3.0/gems/crass-1.0.6/LICENSE +0 -18
- data/vendor/bundle/ruby/3.3.0/gems/crass-1.0.6/README.md +0 -192
- data/vendor/bundle/ruby/3.3.0/gems/crass-1.0.6/crass.gemspec +0 -31
- data/vendor/bundle/ruby/3.3.0/gems/diff-lcs-1.5.1/README.rdoc +0 -84
- data/vendor/bundle/ruby/3.3.0/gems/docile-1.4.1/LICENSE +0 -21
- data/vendor/bundle/ruby/3.3.0/gems/docile-1.4.1/README.md +0 -409
- data/vendor/bundle/ruby/3.3.0/gems/docile-1.4.1/docile.gemspec +0 -36
- data/vendor/bundle/ruby/3.3.0/gems/drb-2.2.1/LICENSE.txt +0 -22
- data/vendor/bundle/ruby/3.3.0/gems/drb-2.2.1/drb.gemspec +0 -41
- data/vendor/bundle/ruby/3.3.0/gems/erubi-1.13.0/CHANGELOG +0 -107
- data/vendor/bundle/ruby/3.3.0/gems/erubi-1.13.0/MIT-LICENSE +0 -21
- data/vendor/bundle/ruby/3.3.0/gems/erubi-1.13.0/README.rdoc +0 -151
- data/vendor/bundle/ruby/3.3.0/gems/i18n-1.14.5/MIT-LICENSE +0 -20
- data/vendor/bundle/ruby/3.3.0/gems/i18n-1.14.5/README.md +0 -127
- data/vendor/bundle/ruby/3.3.0/gems/io-console-0.7.2/LICENSE.txt +0 -22
- data/vendor/bundle/ruby/3.3.0/gems/io-console-0.7.2/README.md +0 -46
- data/vendor/bundle/ruby/3.3.0/gems/irb-1.14.0/LICENSE.txt +0 -22
- data/vendor/bundle/ruby/3.3.0/gems/irb-1.14.0/README.md +0 -405
- data/vendor/bundle/ruby/3.3.0/gems/irb-1.14.0/irb.gemspec +0 -46
- data/vendor/bundle/ruby/3.3.0/gems/json-2.7.2/LICENSE +0 -56
- data/vendor/bundle/ruby/3.3.0/gems/json-2.7.2/README.md +0 -416
- data/vendor/bundle/ruby/3.3.0/gems/json-2.7.2/json.gemspec +0 -68
- data/vendor/bundle/ruby/3.3.0/gems/language_server-protocol-3.17.0.3/LICENSE.txt +0 -21
- data/vendor/bundle/ruby/3.3.0/gems/language_server-protocol-3.17.0.3/README.md +0 -88
- data/vendor/bundle/ruby/3.3.0/gems/loofah-2.22.0/CHANGELOG.md +0 -566
- data/vendor/bundle/ruby/3.3.0/gems/loofah-2.22.0/MIT-LICENSE.txt +0 -23
- data/vendor/bundle/ruby/3.3.0/gems/loofah-2.22.0/README.md +0 -363
- data/vendor/bundle/ruby/3.3.0/gems/method_source-1.1.0/CHANGELOG.md +0 -15
- data/vendor/bundle/ruby/3.3.0/gems/method_source-1.1.0/LICENSE +0 -22
- data/vendor/bundle/ruby/3.3.0/gems/method_source-1.1.0/README.markdown +0 -101
- data/vendor/bundle/ruby/3.3.0/gems/method_source-1.1.0/method_source.gemspec +0 -19
- data/vendor/bundle/ruby/3.3.0/gems/minitest-5.25.1/README.rdoc +0 -835
- data/vendor/bundle/ruby/3.3.0/gems/nokogiri-1.16.7-x86_64-linux/LICENSE-DEPENDENCIES.md +0 -2224
- data/vendor/bundle/ruby/3.3.0/gems/nokogiri-1.16.7-x86_64-linux/LICENSE.md +0 -9
- data/vendor/bundle/ruby/3.3.0/gems/nokogiri-1.16.7-x86_64-linux/README.md +0 -290
- data/vendor/bundle/ruby/3.3.0/gems/parallel-1.26.3/MIT-LICENSE.txt +0 -20
- data/vendor/bundle/ruby/3.3.0/gems/parser-3.3.4.2/LICENSE.txt +0 -25
- data/vendor/bundle/ruby/3.3.0/gems/parser-3.3.4.2/parser.gemspec +0 -43
- data/vendor/bundle/ruby/3.3.0/gems/pry-0.14.2/CHANGELOG.md +0 -1141
- data/vendor/bundle/ruby/3.3.0/gems/pry-0.14.2/LICENSE +0 -25
- data/vendor/bundle/ruby/3.3.0/gems/pry-0.14.2/README.md +0 -466
- data/vendor/bundle/ruby/3.3.0/gems/pry-0.14.2/lib/pry/slop/LICENSE +0 -20
- data/vendor/bundle/ruby/3.3.0/gems/pry-byebug-3.10.1/CHANGELOG.md +0 -230
- data/vendor/bundle/ruby/3.3.0/gems/pry-byebug-3.10.1/LICENSE +0 -20
- data/vendor/bundle/ruby/3.3.0/gems/pry-byebug-3.10.1/README.md +0 -189
- data/vendor/bundle/ruby/3.3.0/gems/public_suffix-6.0.1/CHANGELOG.md +0 -491
- data/vendor/bundle/ruby/3.3.0/gems/public_suffix-6.0.1/LICENSE.txt +0 -22
- data/vendor/bundle/ruby/3.3.0/gems/public_suffix-6.0.1/README.md +0 -222
- data/vendor/bundle/ruby/3.3.0/gems/racc-1.8.1/README.ja.rdoc +0 -58
- data/vendor/bundle/ruby/3.3.0/gems/racc-1.8.1/README.rdoc +0 -60
- data/vendor/bundle/ruby/3.3.0/gems/rack-3.1.7/CHANGELOG.md +0 -994
- data/vendor/bundle/ruby/3.3.0/gems/rack-3.1.7/MIT-LICENSE +0 -20
- data/vendor/bundle/ruby/3.3.0/gems/rack-3.1.7/README.md +0 -328
- data/vendor/bundle/ruby/3.3.0/gems/rack-test-2.1.0/MIT-LICENSE.txt +0 -20
- data/vendor/bundle/ruby/3.3.0/gems/rack-test-2.1.0/README.md +0 -139
- data/vendor/bundle/ruby/3.3.0/gems/rails-dom-testing-2.2.0/MIT-LICENSE +0 -23
- data/vendor/bundle/ruby/3.3.0/gems/rails-dom-testing-2.2.0/README.md +0 -91
- data/vendor/bundle/ruby/3.3.0/gems/rails-html-sanitizer-1.6.0/CHANGELOG.md +0 -201
- data/vendor/bundle/ruby/3.3.0/gems/rails-html-sanitizer-1.6.0/MIT-LICENSE +0 -23
- data/vendor/bundle/ruby/3.3.0/gems/rails-html-sanitizer-1.6.0/README.md +0 -271
- data/vendor/bundle/ruby/3.3.0/gems/railties-7.2.1/CHANGELOG.md +0 -361
- data/vendor/bundle/ruby/3.3.0/gems/railties-7.2.1/MIT-LICENSE +0 -20
- data/vendor/bundle/ruby/3.3.0/gems/railties-7.2.1/README.rdoc +0 -39
- data/vendor/bundle/ruby/3.3.0/gems/railties-7.2.1/lib/rails/generators/rails/app/templates/README.md.tt +0 -24
- data/vendor/bundle/ruby/3.3.0/gems/railties-7.2.1/lib/rails/generators/rails/plugin/templates/%name%.gemspec.tt +0 -28
- data/vendor/bundle/ruby/3.3.0/gems/railties-7.2.1/lib/rails/generators/rails/plugin/templates/MIT-LICENSE.tt +0 -20
- data/vendor/bundle/ruby/3.3.0/gems/railties-7.2.1/lib/rails/generators/rails/plugin/templates/README.md.tt +0 -28
- data/vendor/bundle/ruby/3.3.0/gems/rainbow-3.1.1/LICENSE +0 -20
- data/vendor/bundle/ruby/3.3.0/gems/rainbow-3.1.1/README.markdown +0 -227
- data/vendor/bundle/ruby/3.3.0/gems/rake-13.2.1/MIT-LICENSE +0 -21
- data/vendor/bundle/ruby/3.3.0/gems/rake-13.2.1/README.rdoc +0 -155
- data/vendor/bundle/ruby/3.3.0/gems/rake-13.2.1/rake.gemspec +0 -101
- data/vendor/bundle/ruby/3.3.0/gems/rake-release-1.3.0/LICENSE +0 -21
- data/vendor/bundle/ruby/3.3.0/gems/rake-release-1.3.0/README.md +0 -107
- data/vendor/bundle/ruby/3.3.0/gems/rake-release-1.3.0/rake-release.gemspec +0 -23
- data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.7.0/LICENSE.rdoc +0 -57
- data/vendor/bundle/ruby/3.3.0/gems/rdoc-6.7.0/README.rdoc +0 -129
- data/vendor/bundle/ruby/3.3.0/gems/regexp_parser-2.9.2/LICENSE +0 -22
- data/vendor/bundle/ruby/3.3.0/gems/regexp_parser-2.9.2/regexp_parser.gemspec +0 -34
- data/vendor/bundle/ruby/3.3.0/gems/reline-0.5.9/README.md +0 -94
- data/vendor/bundle/ruby/3.3.0/gems/rexml-3.3.6/LICENSE.txt +0 -22
- data/vendor/bundle/ruby/3.3.0/gems/rexml-3.3.6/README.md +0 -57
- data/vendor/bundle/ruby/3.3.0/gems/rspec-3.13.0/LICENSE.md +0 -27
- data/vendor/bundle/ruby/3.3.0/gems/rspec-3.13.0/README.md +0 -47
- data/vendor/bundle/ruby/3.3.0/gems/rspec-core-3.13.0/LICENSE.md +0 -26
- data/vendor/bundle/ruby/3.3.0/gems/rspec-core-3.13.0/README.md +0 -389
- data/vendor/bundle/ruby/3.3.0/gems/rspec-expectations-3.13.2/LICENSE.md +0 -25
- data/vendor/bundle/ruby/3.3.0/gems/rspec-expectations-3.13.2/README.md +0 -326
- data/vendor/bundle/ruby/3.3.0/gems/rspec-mocks-3.13.1/LICENSE.md +0 -25
- data/vendor/bundle/ruby/3.3.0/gems/rspec-mocks-3.13.1/README.md +0 -465
- data/vendor/bundle/ruby/3.3.0/gems/rspec-rails-6.1.4/LICENSE.md +0 -25
- data/vendor/bundle/ruby/3.3.0/gems/rspec-rails-6.1.4/README.md +0 -381
- data/vendor/bundle/ruby/3.3.0/gems/rspec-support-3.13.1/LICENSE.md +0 -23
- data/vendor/bundle/ruby/3.3.0/gems/rspec-support-3.13.1/README.md +0 -40
- data/vendor/bundle/ruby/3.3.0/gems/rubocop-1.65.1/LICENSE.txt +0 -20
- data/vendor/bundle/ruby/3.3.0/gems/rubocop-1.65.1/README.md +0 -251
- data/vendor/bundle/ruby/3.3.0/gems/rubocop-ast-1.32.1/LICENSE.txt +0 -20
- data/vendor/bundle/ruby/3.3.0/gems/rubocop-ast-1.32.1/README.md +0 -56
- data/vendor/bundle/ruby/3.3.0/gems/rubocop-capybara-2.21.0/CHANGELOG.md +0 -85
- data/vendor/bundle/ruby/3.3.0/gems/rubocop-capybara-2.21.0/MIT-LICENSE.md +0 -21
- data/vendor/bundle/ruby/3.3.0/gems/rubocop-capybara-2.21.0/README.md +0 -88
- data/vendor/bundle/ruby/3.3.0/gems/rubocop-factory_bot-2.26.1/CHANGELOG.md +0 -116
- data/vendor/bundle/ruby/3.3.0/gems/rubocop-factory_bot-2.26.1/MIT-LICENSE.md +0 -21
- data/vendor/bundle/ruby/3.3.0/gems/rubocop-factory_bot-2.26.1/README.md +0 -88
- data/vendor/bundle/ruby/3.3.0/gems/rubocop-performance-1.21.1/LICENSE.txt +0 -20
- data/vendor/bundle/ruby/3.3.0/gems/rubocop-performance-1.21.1/README.md +0 -97
- data/vendor/bundle/ruby/3.3.0/gems/rubocop-rspec-3.0.4/CHANGELOG.md +0 -1028
- data/vendor/bundle/ruby/3.3.0/gems/rubocop-rspec-3.0.4/MIT-LICENSE.md +0 -21
- data/vendor/bundle/ruby/3.3.0/gems/rubocop-rspec-3.0.4/README.md +0 -109
- data/vendor/bundle/ruby/3.3.0/gems/rubocop-rspec_rails-2.30.0/CHANGELOG.md +0 -84
- data/vendor/bundle/ruby/3.3.0/gems/rubocop-rspec_rails-2.30.0/MIT-LICENSE.md +0 -21
- data/vendor/bundle/ruby/3.3.0/gems/rubocop-rspec_rails-2.30.0/README.md +0 -90
- data/vendor/bundle/ruby/3.3.0/gems/ruby-progressbar-1.13.0/LICENSE.txt +0 -19
- data/vendor/bundle/ruby/3.3.0/gems/ruby-progressbar-1.13.0/README.md +0 -131
- data/vendor/bundle/ruby/3.3.0/gems/simplecov-0.22.0/CHANGELOG.md +0 -191
- data/vendor/bundle/ruby/3.3.0/gems/simplecov-0.22.0/LICENSE +0 -20
- data/vendor/bundle/ruby/3.3.0/gems/simplecov-0.22.0/README.md +0 -974
- data/vendor/bundle/ruby/3.3.0/gems/simplecov-cobertura-2.1.0/LICENSE +0 -202
- data/vendor/bundle/ruby/3.3.0/gems/simplecov-cobertura-2.1.0/README.md +0 -62
- data/vendor/bundle/ruby/3.3.0/gems/simplecov-cobertura-2.1.0/simplecov-cobertura.gemspec +0 -29
- data/vendor/bundle/ruby/3.3.0/gems/simplecov-html-0.12.3/CHANGELOG.md +0 -81
- data/vendor/bundle/ruby/3.3.0/gems/simplecov-html-0.12.3/LICENSE +0 -20
- data/vendor/bundle/ruby/3.3.0/gems/simplecov-html-0.12.3/README.md +0 -30
- data/vendor/bundle/ruby/3.3.0/gems/simplecov-html-0.12.3/simplecov-html.gemspec +0 -23
- data/vendor/bundle/ruby/3.3.0/gems/simplecov_json_formatter-0.1.4/CHANGELOG.md +0 -13
- data/vendor/bundle/ruby/3.3.0/gems/simplecov_json_formatter-0.1.4/README.md +0 -29
- data/vendor/bundle/ruby/3.3.0/gems/strscan-3.1.0/LICENSE.txt +0 -22
- data/vendor/bundle/ruby/3.3.0/gems/thor-1.3.1/LICENSE.md +0 -20
- data/vendor/bundle/ruby/3.3.0/gems/thor-1.3.1/README.md +0 -45
- data/vendor/bundle/ruby/3.3.0/gems/thor-1.3.1/thor.gemspec +0 -33
- data/vendor/bundle/ruby/3.3.0/gems/tzinfo-2.0.6/LICENSE +0 -19
- data/vendor/bundle/ruby/3.3.0/gems/tzinfo-2.0.6/README.md +0 -406
- data/vendor/bundle/ruby/3.3.0/gems/unicode-display_width-2.5.0/CHANGELOG.md +0 -196
- data/vendor/bundle/ruby/3.3.0/gems/unicode-display_width-2.5.0/MIT-LICENSE.txt +0 -22
- data/vendor/bundle/ruby/3.3.0/gems/unicode-display_width-2.5.0/README.md +0 -171
- data/vendor/bundle/ruby/3.3.0/gems/useragent-0.16.10/LICENSE +0 -20
- data/vendor/bundle/ruby/3.3.0/gems/useragent-0.16.10/README.md +0 -42
- data/vendor/bundle/ruby/3.3.0/gems/webrick-1.8.1/LICENSE.txt +0 -22
- data/vendor/bundle/ruby/3.3.0/gems/webrick-1.8.1/README.md +0 -61
- data/vendor/bundle/ruby/3.3.0/gems/webrick-1.8.1/webrick.gemspec +0 -70
- data/vendor/bundle/ruby/3.3.0/gems/zeitwerk-2.6.17/MIT-LICENSE +0 -20
- data/vendor/bundle/ruby/3.3.0/gems/zeitwerk-2.6.17/README.md +0 -1494
- data/vendor/bundle/ruby/3.3.0/specifications/actionpack-7.2.1.gemspec +0 -37
- data/vendor/bundle/ruby/3.3.0/specifications/actionview-7.2.1.gemspec +0 -33
- data/vendor/bundle/ruby/3.3.0/specifications/activesupport-7.2.1.gemspec +0 -36
- data/vendor/bundle/ruby/3.3.0/specifications/addressable-2.8.7.gemspec +0 -30
- data/vendor/bundle/ruby/3.3.0/specifications/appraisal-2.5.0.gemspec +0 -31
- data/vendor/bundle/ruby/3.3.0/specifications/ast-2.4.2.gemspec +0 -30
- data/vendor/bundle/ruby/3.3.0/specifications/benchmark-ips-2.13.0.gemspec +0 -28
- data/vendor/bundle/ruby/3.3.0/specifications/bigdecimal-3.1.8.gemspec +0 -25
- data/vendor/bundle/ruby/3.3.0/specifications/builder-3.3.0.gemspec +0 -22
- data/vendor/bundle/ruby/3.3.0/specifications/byebug-11.1.3.gemspec +0 -31
- data/vendor/bundle/ruby/3.3.0/specifications/coderay-1.1.3.gemspec +0 -25
- data/vendor/bundle/ruby/3.3.0/specifications/concurrent-ruby-1.3.4.gemspec +0 -24
- data/vendor/bundle/ruby/3.3.0/specifications/connection_pool-2.4.1.gemspec +0 -28
- data/vendor/bundle/ruby/3.3.0/specifications/crass-1.0.6.gemspec +0 -27
- data/vendor/bundle/ruby/3.3.0/specifications/diff-lcs-1.5.1.gemspec +0 -37
- data/vendor/bundle/ruby/3.3.0/specifications/docile-1.4.1.gemspec +0 -22
- data/vendor/bundle/ruby/3.3.0/specifications/drb-2.2.1.gemspec +0 -22
- data/vendor/bundle/ruby/3.3.0/specifications/erubi-1.13.0.gemspec +0 -29
- data/vendor/bundle/ruby/3.3.0/specifications/i18n-1.14.5.gemspec +0 -26
- data/vendor/bundle/ruby/3.3.0/specifications/io-console-0.7.2.gemspec +0 -25
- data/vendor/bundle/ruby/3.3.0/specifications/irb-1.14.0.gemspec +0 -30
- data/vendor/bundle/ruby/3.3.0/specifications/json-2.7.2.gemspec +0 -0
- data/vendor/bundle/ruby/3.3.0/specifications/language_server-protocol-3.17.0.3.gemspec +0 -31
- data/vendor/bundle/ruby/3.3.0/specifications/loofah-2.22.0.gemspec +0 -27
- data/vendor/bundle/ruby/3.3.0/specifications/method_source-1.1.0.gemspec +0 -21
- data/vendor/bundle/ruby/3.3.0/specifications/minitest-5.25.1.gemspec +0 -31
- data/vendor/bundle/ruby/3.3.0/specifications/nokogiri-1.16.7-x86_64-linux.gemspec +0 -31
- data/vendor/bundle/ruby/3.3.0/specifications/parallel-1.26.3.gemspec +0 -21
- data/vendor/bundle/ruby/3.3.0/specifications/parser-3.3.4.2.gemspec +0 -37
- data/vendor/bundle/ruby/3.3.0/specifications/pry-0.14.2.gemspec +0 -29
- data/vendor/bundle/ruby/3.3.0/specifications/pry-byebug-3.10.1.gemspec +0 -28
- data/vendor/bundle/ruby/3.3.0/specifications/public_suffix-6.0.1.gemspec +0 -24
- data/vendor/bundle/ruby/3.3.0/specifications/racc-1.8.1.gemspec +0 -28
- data/vendor/bundle/ruby/3.3.0/specifications/rack-3.1.7.gemspec +0 -31
- data/vendor/bundle/ruby/3.3.0/specifications/rack-session-2.0.0.gemspec +0 -28
- data/vendor/bundle/ruby/3.3.0/specifications/rack-test-2.1.0.gemspec +0 -29
- data/vendor/bundle/ruby/3.3.0/specifications/rackup-2.1.0.gemspec +0 -31
- data/vendor/bundle/ruby/3.3.0/specifications/rails-dom-testing-2.2.0.gemspec +0 -28
- data/vendor/bundle/ruby/3.3.0/specifications/rails-html-sanitizer-1.6.0.gemspec +0 -27
- data/vendor/bundle/ruby/3.3.0/specifications/railties-7.2.1.gemspec +0 -37
- data/vendor/bundle/ruby/3.3.0/specifications/rainbow-3.1.1.gemspec +0 -25
- data/vendor/bundle/ruby/3.3.0/specifications/rake-13.2.1.gemspec +0 -26
- data/vendor/bundle/ruby/3.3.0/specifications/rake-release-1.3.0.gemspec +0 -26
- data/vendor/bundle/ruby/3.3.0/specifications/rdoc-6.7.0.gemspec +0 -31
- data/vendor/bundle/ruby/3.3.0/specifications/regexp_parser-2.9.2.gemspec +0 -22
- data/vendor/bundle/ruby/3.3.0/specifications/reline-0.5.9.gemspec +0 -26
- data/vendor/bundle/ruby/3.3.0/specifications/rexml-3.3.6.gemspec +0 -29
- data/vendor/bundle/ruby/3.3.0/specifications/rspec-3.13.0.gemspec +0 -31
- data/vendor/bundle/ruby/3.3.0/specifications/rspec-core-3.13.0.gemspec +0 -39
- data/vendor/bundle/ruby/3.3.0/specifications/rspec-expectations-3.13.2.gemspec +0 -33
- data/vendor/bundle/ruby/3.3.0/specifications/rspec-mocks-3.13.1.gemspec +0 -33
- data/vendor/bundle/ruby/3.3.0/specifications/rspec-rails-6.1.4.gemspec +0 -37
- data/vendor/bundle/ruby/3.3.0/specifications/rspec-support-3.13.1.gemspec +0 -29
- data/vendor/bundle/ruby/3.3.0/specifications/rubocop-1.65.1.gemspec +0 -39
- data/vendor/bundle/ruby/3.3.0/specifications/rubocop-ast-1.32.1.gemspec +0 -28
- data/vendor/bundle/ruby/3.3.0/specifications/rubocop-capybara-2.21.0.gemspec +0 -27
- data/vendor/bundle/ruby/3.3.0/specifications/rubocop-factory_bot-2.26.1.gemspec +0 -27
- data/vendor/bundle/ruby/3.3.0/specifications/rubocop-performance-1.21.1.gemspec +0 -29
- data/vendor/bundle/ruby/3.3.0/specifications/rubocop-rspec-3.0.4.gemspec +0 -28
- data/vendor/bundle/ruby/3.3.0/specifications/rubocop-rspec_rails-2.30.0.gemspec +0 -28
- data/vendor/bundle/ruby/3.3.0/specifications/ruby-progressbar-1.13.0.gemspec +0 -29
- data/vendor/bundle/ruby/3.3.0/specifications/simplecov-0.22.0.gemspec +0 -28
- data/vendor/bundle/ruby/3.3.0/specifications/simplecov-cobertura-2.1.0.gemspec +0 -29
- data/vendor/bundle/ruby/3.3.0/specifications/simplecov-html-0.12.3.gemspec +0 -21
- data/vendor/bundle/ruby/3.3.0/specifications/simplecov_json_formatter-0.1.4.gemspec +0 -21
- data/vendor/bundle/ruby/3.3.0/specifications/strscan-3.1.0.gemspec +0 -24
- data/vendor/bundle/ruby/3.3.0/specifications/thor-1.3.1.gemspec +0 -28
- data/vendor/bundle/ruby/3.3.0/specifications/tzinfo-2.0.6.gemspec +0 -30
- data/vendor/bundle/ruby/3.3.0/specifications/unicode-display_width-2.5.0.gemspec +0 -29
- data/vendor/bundle/ruby/3.3.0/specifications/useragent-0.16.10.gemspec +0 -25
- data/vendor/bundle/ruby/3.3.0/specifications/webrick-1.8.1.gemspec +0 -22
- data/vendor/bundle/ruby/3.3.0/specifications/zeitwerk-2.6.17.gemspec +0 -22
@@ -1,974 +0,0 @@
|
|
1
|
-
SimpleCov [![Gem Version](https://badge.fury.io/rb/simplecov.svg)](https://badge.fury.io/rb/simplecov) [![Build Status](https://github.com/simplecov-ruby/simplecov/workflows/stable/badge.svg?branch=main)][Continuous Integration] [![Maintainability](https://api.codeclimate.com/v1/badges/c071d197d61953a7e482/maintainability)](https://codeclimate.com/github/simplecov-ruby/simplecov/maintainability) [![Inline docs](http://inch-ci.org/github/simplecov-ruby/simplecov.svg?branch=main)](http://inch-ci.org/github/simplecov-ruby/simplecov)
|
2
|
-
=========
|
3
|
-
|
4
|
-
**Code coverage for Ruby**
|
5
|
-
|
6
|
-
* [Source Code]
|
7
|
-
* [API documentation]
|
8
|
-
* [Changelog]
|
9
|
-
* [Rubygem]
|
10
|
-
* [Continuous Integration]
|
11
|
-
|
12
|
-
[Coverage]: https://ruby-doc.org/stdlib/libdoc/coverage/rdoc/Coverage.html "API doc for Ruby's Coverage library"
|
13
|
-
[Source Code]: https://github.com/simplecov-ruby/simplecov "Source Code @ GitHub"
|
14
|
-
[API documentation]: http://rubydoc.info/gems/simplecov/frames "RDoc API Documentation at Rubydoc.info"
|
15
|
-
[Configuration]: http://rubydoc.info/gems/simplecov/SimpleCov/Configuration "Configuration options API documentation"
|
16
|
-
[Changelog]: https://github.com/simplecov-ruby/simplecov/blob/main/CHANGELOG.md "Project Changelog"
|
17
|
-
[Rubygem]: http://rubygems.org/gems/simplecov "SimpleCov @ rubygems.org"
|
18
|
-
[Continuous Integration]: https://github.com/simplecov-ruby/simplecov/actions?query=workflow%3Astable "SimpleCov is built around the clock by github.com"
|
19
|
-
[Dependencies]: https://gemnasium.com/simplecov-ruby/simplecov "SimpleCov dependencies on Gemnasium"
|
20
|
-
[simplecov-html]: https://github.com/simplecov-ruby/simplecov-html "SimpleCov HTML Formatter Source Code @ GitHub"
|
21
|
-
|
22
|
-
SimpleCov is a code coverage analysis tool for Ruby. It uses [Ruby's built-in Coverage][Coverage] library to gather code
|
23
|
-
coverage data, but makes processing its results much easier by providing a clean API to filter, group, merge, format,
|
24
|
-
and display those results, giving you a complete code coverage suite that can be set up with just a couple lines of
|
25
|
-
code.
|
26
|
-
SimpleCov/Coverage track covered ruby code, gathering coverage for common templating solutions like erb, slim and haml is not supported.
|
27
|
-
|
28
|
-
In most cases, you'll want overall coverage results for your projects, including all types of tests, Cucumber features,
|
29
|
-
etc. SimpleCov automatically takes care of this by caching and merging results when generating reports, so your
|
30
|
-
report actually includes coverage across your test suites and thereby gives you a better picture of blank spots.
|
31
|
-
|
32
|
-
The official formatter of SimpleCov is packaged as a separate gem called [simplecov-html], but will be installed and
|
33
|
-
configured automatically when you launch SimpleCov. If you're curious, you can find it [on GitHub, too][simplecov-html].
|
34
|
-
|
35
|
-
|
36
|
-
## Contact
|
37
|
-
|
38
|
-
*Code and Bug Reports*
|
39
|
-
|
40
|
-
* [Issue Tracker](https://github.com/simplecov-ruby/simplecov/issues)
|
41
|
-
* See [CONTRIBUTING](https://github.com/simplecov-ruby/simplecov/blob/main/CONTRIBUTING.md) for how to contribute along
|
42
|
-
with some common problems to check out before creating an issue.
|
43
|
-
|
44
|
-
*Questions, Problems, Suggestions, etc.*
|
45
|
-
|
46
|
-
* [Mailing List](https://groups.google.com/forum/#!forum/simplecov) "Open mailing list for discussion and announcements
|
47
|
-
on Google Groups"
|
48
|
-
|
49
|
-
Getting started
|
50
|
-
---------------
|
51
|
-
1. Add SimpleCov to your `Gemfile` and `bundle install`:
|
52
|
-
|
53
|
-
```ruby
|
54
|
-
gem 'simplecov', require: false, group: :test
|
55
|
-
```
|
56
|
-
2. Load and launch SimpleCov **at the very top** of your `test/test_helper.rb`
|
57
|
-
(*or `spec_helper.rb`, `rails_helper`, cucumber `env.rb`, or whatever your preferred test
|
58
|
-
framework uses*):
|
59
|
-
|
60
|
-
```ruby
|
61
|
-
require 'simplecov'
|
62
|
-
SimpleCov.start
|
63
|
-
|
64
|
-
# Previous content of test helper now starts here
|
65
|
-
```
|
66
|
-
|
67
|
-
**Note:** If SimpleCov starts after your application code is already loaded
|
68
|
-
(via `require`), it won't be able to track your files and their coverage!
|
69
|
-
The `SimpleCov.start` **must** be issued **before any of your application
|
70
|
-
code is required!**
|
71
|
-
|
72
|
-
This is especially true if you use anything that keeps your tests application loaded like spring, check out the **[spring section](#want-to-use-spring-with-simplecov)**.
|
73
|
-
|
74
|
-
SimpleCov must be running in the process that you want the code coverage
|
75
|
-
analysis to happen on. When testing a server process (e.g. a JSON API
|
76
|
-
endpoint) via a separate test process (e.g. when using Selenium) where you
|
77
|
-
want to see all code executed by the `rails server`, and not just code
|
78
|
-
executed in your actual test files, you need to require SimpleCov in the
|
79
|
-
server process. For rails for instance, you'll want to add something like this
|
80
|
-
to the top of `bin/rails`, but below the "shebang" line (`#! /usr/bin/env
|
81
|
-
ruby`) and after config/boot is required:
|
82
|
-
|
83
|
-
```ruby
|
84
|
-
if ENV['RAILS_ENV'] == 'test'
|
85
|
-
require 'simplecov'
|
86
|
-
SimpleCov.start 'rails'
|
87
|
-
puts "required simplecov"
|
88
|
-
end
|
89
|
-
```
|
90
|
-
|
91
|
-
3. Run your full test suite to see the percent coverage that your application has.
|
92
|
-
4. After running your tests, open `coverage/index.html` in the browser of your choice. For example, in a Mac Terminal,
|
93
|
-
run the following command from your application's root directory:
|
94
|
-
|
95
|
-
```
|
96
|
-
open coverage/index.html
|
97
|
-
```
|
98
|
-
in a debian/ubuntu Terminal,
|
99
|
-
|
100
|
-
```
|
101
|
-
xdg-open coverage/index.html
|
102
|
-
```
|
103
|
-
|
104
|
-
**Note:** [This guide](https://dwheeler.com/essays/open-files-urls.html) can help if you're unsure which command your particular
|
105
|
-
operating system requires.
|
106
|
-
|
107
|
-
5. Add the following to your `.gitignore` file to ensure that coverage results
|
108
|
-
are not tracked by Git (optional):
|
109
|
-
|
110
|
-
```
|
111
|
-
echo coverage >> .gitignore
|
112
|
-
```
|
113
|
-
|
114
|
-
If you're making a Rails application, SimpleCov comes with built-in configurations (see below for information on
|
115
|
-
profiles) that will get you started with groups for your Controllers, Models and Helpers. To use it, the
|
116
|
-
first two lines of your test_helper should be like this:
|
117
|
-
|
118
|
-
```ruby
|
119
|
-
require 'simplecov'
|
120
|
-
SimpleCov.start 'rails'
|
121
|
-
```
|
122
|
-
|
123
|
-
## Example output
|
124
|
-
|
125
|
-
**Coverage results report, fully browsable locally with sorting and much more:**
|
126
|
-
|
127
|
-
![SimpleCov coverage report](https://cloud.githubusercontent.com/assets/137793/17071162/db6f253e-502d-11e6-9d84-e40c3d75f333.png)
|
128
|
-
|
129
|
-
|
130
|
-
**Source file coverage details view:**
|
131
|
-
|
132
|
-
![SimpleCov source file detail view](https://cloud.githubusercontent.com/assets/137793/17071163/db6f9f0a-502d-11e6-816c-edb2c66fad8d.png)
|
133
|
-
|
134
|
-
## Use it with any framework!
|
135
|
-
|
136
|
-
Similarly to the usage with Test::Unit described above, the only thing you have to do is to add the SimpleCov
|
137
|
-
config to the very top of your Cucumber/RSpec/whatever setup file.
|
138
|
-
|
139
|
-
Add the setup code to the **top** of `features/support/env.rb` (for Cucumber) or `spec/spec_helper.rb` (for RSpec).
|
140
|
-
Other test frameworks should work accordingly, whatever their setup file may be:
|
141
|
-
|
142
|
-
```ruby
|
143
|
-
require 'simplecov'
|
144
|
-
SimpleCov.start 'rails'
|
145
|
-
```
|
146
|
-
|
147
|
-
You could even track what kind of code your UI testers are touching if you want to go overboard with things. SimpleCov
|
148
|
-
does not care what kind of framework it is running in; it just looks at what code is being executed and generates a
|
149
|
-
report about it.
|
150
|
-
|
151
|
-
### Notes on specific frameworks and test utilities
|
152
|
-
|
153
|
-
For some frameworks and testing tools there are quirks and problems you might want to know about if you want
|
154
|
-
to use SimpleCov with them. Here's an overview of the known ones:
|
155
|
-
|
156
|
-
<table>
|
157
|
-
<tr><th>Framework</th><th>Notes</th><th>Issue</th></tr>
|
158
|
-
<tr>
|
159
|
-
<th>
|
160
|
-
parallel_tests
|
161
|
-
</th>
|
162
|
-
<td>
|
163
|
-
As of 0.8.0, SimpleCov should correctly recognize parallel_tests and
|
164
|
-
supplement your test suite names with their corresponding test env
|
165
|
-
numbers. SimpleCov locks the resultset cache while merging, ensuring no
|
166
|
-
race conditions occur when results are merged.
|
167
|
-
</td>
|
168
|
-
<td>
|
169
|
-
<a href="https://github.com/simplecov-ruby/simplecov/issues/64">#64</a> &
|
170
|
-
<a href="https://github.com/simplecov-ruby/simplecov/pull/185">#185</a>
|
171
|
-
</td>
|
172
|
-
</tr>
|
173
|
-
<tr>
|
174
|
-
<th>
|
175
|
-
knapsack_pro
|
176
|
-
</th>
|
177
|
-
<td>
|
178
|
-
To make SimpleCov work with Knapsack Pro Queue Mode to split tests in parallel on CI jobs you need to provide CI node index number to the <code>SimpleCov.command_name</code> in <code>KnapsackPro::Hooks::Queue.before_queue</code> hook.
|
179
|
-
</td>
|
180
|
-
<td>
|
181
|
-
<a href="https://knapsackpro.com/faq/question/how-to-use-simplecov-in-queue-mode">Tip</a>
|
182
|
-
</td>
|
183
|
-
</tr>
|
184
|
-
<tr>
|
185
|
-
<th>
|
186
|
-
RubyMine
|
187
|
-
</th>
|
188
|
-
<td>
|
189
|
-
The <a href="https://www.jetbrains.com/ruby/">RubyMine IDE</a> has
|
190
|
-
built-in support for SimpleCov's coverage reports, though you might need
|
191
|
-
to explicitly set the output root using `SimpleCov.root('foo/bar/baz')`
|
192
|
-
</td>
|
193
|
-
<td>
|
194
|
-
<a href="https://github.com/simplecov-ruby/simplecov/issues/95">#95</a>
|
195
|
-
</td>
|
196
|
-
</tr>
|
197
|
-
<tr>
|
198
|
-
<th>
|
199
|
-
Spork
|
200
|
-
</th>
|
201
|
-
<td>
|
202
|
-
Because of how Spork works internally (using preforking), there used to
|
203
|
-
be trouble when using SimpleCov with it, but that has apparently been
|
204
|
-
resolved with a specific configuration strategy. See <a
|
205
|
-
href="https://github.com/simplecov-ruby/simplecov/issues/42#issuecomment-4440284">this</a>
|
206
|
-
comment.
|
207
|
-
</td>
|
208
|
-
<td>
|
209
|
-
<a href="https://github.com/simplecov-ruby/simplecov/issues/42#issuecomment-4440284">#42</a>
|
210
|
-
</td>
|
211
|
-
</tr>
|
212
|
-
<tr>
|
213
|
-
<th>
|
214
|
-
Spring
|
215
|
-
</th>
|
216
|
-
<td>
|
217
|
-
<a href="#want-to-use-spring-with-simplecov">See section below.</a>
|
218
|
-
</td>
|
219
|
-
<td>
|
220
|
-
<a href="https://github.com/simplecov-ruby/simplecov/issues/381">#381</a>
|
221
|
-
</td>
|
222
|
-
</tr>
|
223
|
-
<tr>
|
224
|
-
<th>
|
225
|
-
Test/Unit
|
226
|
-
</th>
|
227
|
-
<td>
|
228
|
-
Test Unit 2 used to mess with ARGV, leading to a failure to detect the
|
229
|
-
test process name in SimpleCov. <code>test-unit</code> releases 2.4.3+
|
230
|
-
(Dec 11th, 2011) should have this problem resolved.
|
231
|
-
</td>
|
232
|
-
<td>
|
233
|
-
<a href="https://github.com/simplecov-ruby/simplecov/issues/45">#45</a> &
|
234
|
-
<a href="https://github.com/test-unit/test-unit/pull/12">test-unit/test-unit#12</a>
|
235
|
-
</td>
|
236
|
-
</tr>
|
237
|
-
</table>
|
238
|
-
|
239
|
-
## Configuring SimpleCov
|
240
|
-
|
241
|
-
[Configuration] settings can be applied in three formats, which are completely equivalent:
|
242
|
-
|
243
|
-
* The most common way is to configure it directly in your start block:
|
244
|
-
|
245
|
-
```ruby
|
246
|
-
SimpleCov.start do
|
247
|
-
some_config_option 'foo'
|
248
|
-
end
|
249
|
-
```
|
250
|
-
* You can also set all configuration options directly:
|
251
|
-
|
252
|
-
```ruby
|
253
|
-
SimpleCov.some_config_option 'foo'
|
254
|
-
```
|
255
|
-
* If you do not want to start coverage immediately after launch or want to add additional configuration later on in a
|
256
|
-
concise way, use:
|
257
|
-
|
258
|
-
```ruby
|
259
|
-
SimpleCov.configure do
|
260
|
-
some_config_option 'foo'
|
261
|
-
end
|
262
|
-
```
|
263
|
-
|
264
|
-
Please check out the [Configuration] API documentation to find out what you can customize.
|
265
|
-
|
266
|
-
## Using .simplecov for centralized config
|
267
|
-
|
268
|
-
If you use SimpleCov to merge multiple test suite results (e.g. Test/Unit and Cucumber) into a single report, you'd
|
269
|
-
normally have to set up all your config options twice, once in `test_helper.rb` and once in `env.rb`.
|
270
|
-
|
271
|
-
To avoid this, you can place a file called `.simplecov` in your project root. You can then just leave the
|
272
|
-
`require 'simplecov'` in each test setup helper (**at the top**) and move the `SimpleCov.start` code with all your
|
273
|
-
custom config options into `.simplecov`:
|
274
|
-
|
275
|
-
```ruby
|
276
|
-
# test/test_helper.rb
|
277
|
-
require 'simplecov'
|
278
|
-
|
279
|
-
# features/support/env.rb
|
280
|
-
require 'simplecov'
|
281
|
-
|
282
|
-
# .simplecov
|
283
|
-
SimpleCov.start 'rails' do
|
284
|
-
# any custom configs like groups and filters can be here at a central place
|
285
|
-
end
|
286
|
-
```
|
287
|
-
|
288
|
-
Using `.simplecov` rather than separately requiring SimpleCov multiple times is recommended if you are merging multiple
|
289
|
-
test frameworks like Cucumber and RSpec that rely on each other, as invoking SimpleCov multiple times can cause coverage
|
290
|
-
information to be lost.
|
291
|
-
|
292
|
-
## Branch coverage (ruby "~> 2.5")
|
293
|
-
Add branch coverage measurement statistics to your results. Supported in CRuby versions 2.5+.
|
294
|
-
|
295
|
-
```ruby
|
296
|
-
SimpleCov.start do
|
297
|
-
enable_coverage :branch
|
298
|
-
end
|
299
|
-
```
|
300
|
-
|
301
|
-
Branch coverage is a feature introduced in Ruby 2.5 concerning itself with whether a
|
302
|
-
particular branch of a condition had been executed. Line coverage on the other hand
|
303
|
-
is only interested in whether a line of code has been executed.
|
304
|
-
|
305
|
-
This comes in handy for instance for one line conditionals:
|
306
|
-
|
307
|
-
```ruby
|
308
|
-
number.odd? ? "odd" : "even"
|
309
|
-
```
|
310
|
-
|
311
|
-
In line coverage this line would always be marked as executed but you'd never know if both
|
312
|
-
conditions were met. Guard clauses have a similar story:
|
313
|
-
|
314
|
-
```ruby
|
315
|
-
return if number.odd?
|
316
|
-
|
317
|
-
# more code
|
318
|
-
```
|
319
|
-
|
320
|
-
If all the code in that method was covered you'd never know if the guard clause was ever
|
321
|
-
triggered! With line coverage as just evaluating the condition marks it as covered.
|
322
|
-
|
323
|
-
In the HTML report the lines of code will be annotated like `branch_type: hit_count`:
|
324
|
-
|
325
|
-
* `then: 2` - the then branch (of an `if`) was executed twice
|
326
|
-
* `else: 0` - the else branch (of an `if` or `case`) was never executed
|
327
|
-
|
328
|
-
Not that even if you don't declare an `else` branch it will still show up in the coverage
|
329
|
-
reports meaning that the condition of the `if` was not hit or that no `when` of `case`
|
330
|
-
was hit during the test runs.
|
331
|
-
|
332
|
-
**Is branch coverage strictly better?** No. Branch coverage really only concerns itself with
|
333
|
-
conditionals - meaning coverage of sequential code is of no interest to it. A file without
|
334
|
-
conditional logic will have no branch coverage data and SimpleCov will report 0 of 0
|
335
|
-
branches covered as 100% (as everything that can be covered was covered).
|
336
|
-
|
337
|
-
Hence, we recommend looking at both metrics together. Branch coverage might also be a good
|
338
|
-
overall metric to look at - while you might be missing only 10% of your lines that might
|
339
|
-
account for 50% of your branches for instance.
|
340
|
-
|
341
|
-
## Primary Coverage
|
342
|
-
|
343
|
-
By default, the primary coverage type is `line`. To set the primary coverage to something else, use the following:
|
344
|
-
|
345
|
-
```ruby
|
346
|
-
# or in configure SimpleCov.primary_coverage :branch
|
347
|
-
SimpleCov.start do
|
348
|
-
enable_coverage :branch
|
349
|
-
primary_coverage :branch
|
350
|
-
end
|
351
|
-
```
|
352
|
-
|
353
|
-
Primary coverage determines what will come in first all output, and the type of coverage to check if you don't specify the type of coverage when customizing exit behavior (`SimpleCov.minimum_coverage 90`).
|
354
|
-
|
355
|
-
Note that coverage must first be enabled for non-default coverage types.
|
356
|
-
|
357
|
-
## Coverage for eval
|
358
|
-
|
359
|
-
You can measure coverage for code that is evaluated by `Kernel#eval`. Supported in CRuby versions 3.2+.
|
360
|
-
|
361
|
-
```ruby
|
362
|
-
SimpleCov.start do
|
363
|
-
enable_coverage_for_eval
|
364
|
-
end
|
365
|
-
```
|
366
|
-
|
367
|
-
This is typically useful for ERB. Set `ERB#filename=` to make it possible for SimpleCov to trace the original .erb source file.
|
368
|
-
|
369
|
-
## Filters
|
370
|
-
|
371
|
-
Filters can be used to remove selected files from your coverage data. By default, a filter is applied that removes all
|
372
|
-
files OUTSIDE of your project's root directory - otherwise you'd end up with billions of coverage reports for source
|
373
|
-
files in the gems you are using.
|
374
|
-
|
375
|
-
You can define your own to remove things like configuration files, tests or whatever you don't need in your coverage
|
376
|
-
report.
|
377
|
-
|
378
|
-
### Defining custom filters
|
379
|
-
|
380
|
-
You can currently define a filter using either a String or Regexp (that will then be Regexp-matched against each source
|
381
|
-
file's path), a block or by passing in your own Filter class.
|
382
|
-
|
383
|
-
#### String filter
|
384
|
-
|
385
|
-
```ruby
|
386
|
-
SimpleCov.start do
|
387
|
-
add_filter "/test/"
|
388
|
-
end
|
389
|
-
```
|
390
|
-
|
391
|
-
This simple string filter will remove all files that match "/test/" in their path.
|
392
|
-
|
393
|
-
#### Regex filter
|
394
|
-
|
395
|
-
```ruby
|
396
|
-
SimpleCov.start do
|
397
|
-
add_filter %r{^/test/}
|
398
|
-
end
|
399
|
-
```
|
400
|
-
|
401
|
-
This simple regex filter will remove all files that start with /test/ in their path.
|
402
|
-
|
403
|
-
#### Block filter
|
404
|
-
|
405
|
-
```ruby
|
406
|
-
SimpleCov.start do
|
407
|
-
add_filter do |source_file|
|
408
|
-
source_file.lines.count < 5
|
409
|
-
end
|
410
|
-
end
|
411
|
-
```
|
412
|
-
|
413
|
-
Block filters receive a SimpleCov::SourceFile instance and expect your block to return either true (if the file is to be
|
414
|
-
removed from the result) or false (if the result should be kept). Please check out the RDoc for SimpleCov::SourceFile to
|
415
|
-
learn about the methods available to you. In the above example, the filter will remove all files that have less than 5
|
416
|
-
lines of code.
|
417
|
-
|
418
|
-
#### Custom filter class
|
419
|
-
|
420
|
-
```ruby
|
421
|
-
class LineFilter < SimpleCov::Filter
|
422
|
-
def matches?(source_file)
|
423
|
-
source_file.lines.count < filter_argument
|
424
|
-
end
|
425
|
-
end
|
426
|
-
|
427
|
-
SimpleCov.add_filter LineFilter.new(5)
|
428
|
-
```
|
429
|
-
|
430
|
-
Defining your own filters is pretty easy: Just inherit from SimpleCov::Filter and define a method
|
431
|
-
'matches?(source_file)'. When running the filter, a true return value from this method will result in the removal of the
|
432
|
-
given source_file. The filter_argument method is being set in the SimpleCov::Filter initialize method and thus is set to
|
433
|
-
5 in this example.
|
434
|
-
|
435
|
-
#### Array filter
|
436
|
-
|
437
|
-
```ruby
|
438
|
-
SimpleCov.start do
|
439
|
-
proc = Proc.new { |source_file| false }
|
440
|
-
add_filter ["string", /regex/, proc, LineFilter.new(5)]
|
441
|
-
end
|
442
|
-
```
|
443
|
-
|
444
|
-
You can pass in an array containing any of the other filter types.
|
445
|
-
|
446
|
-
#### Ignoring/skipping code
|
447
|
-
|
448
|
-
You can exclude code from the coverage report by wrapping it in `# :nocov:`.
|
449
|
-
|
450
|
-
```ruby
|
451
|
-
# :nocov:
|
452
|
-
def skip_this_method
|
453
|
-
never_reached
|
454
|
-
end
|
455
|
-
# :nocov:
|
456
|
-
```
|
457
|
-
|
458
|
-
The name of the token can be changed to your liking. [Learn more about the nocov feature.]( https://github.com/simplecov-ruby/simplecov/blob/main/features/config_nocov_token.feature)
|
459
|
-
|
460
|
-
**Note:** You shouldn't have to use the nocov token to skip private methods that are being included in your coverage. If
|
461
|
-
you appropriately test the public interface of your classes and objects you should automatically get full coverage of
|
462
|
-
your private methods.
|
463
|
-
|
464
|
-
## Default root filter and coverage for things outside of it
|
465
|
-
|
466
|
-
By default, SimpleCov filters everything outside of the `SimpleCov.root` directory. However, sometimes you may want
|
467
|
-
to include coverage reports for things you include as a gem, for example a Rails Engine.
|
468
|
-
|
469
|
-
Here's an example by [@lsaffie](https://github.com/lsaffie) from [#221](https://github.com/simplecov-ruby/simplecov/issues/221)
|
470
|
-
that shows how you can achieve just that:
|
471
|
-
|
472
|
-
```ruby
|
473
|
-
SimpleCov.start :rails do
|
474
|
-
filters.clear # This will remove the :root_filter and :bundler_filter that come via simplecov's defaults
|
475
|
-
add_filter do |src|
|
476
|
-
!(src.filename =~ /^#{SimpleCov.root}/) unless src.filename =~ /my_engine/
|
477
|
-
end
|
478
|
-
end
|
479
|
-
```
|
480
|
-
|
481
|
-
## Groups
|
482
|
-
|
483
|
-
You can separate your source files into groups. For example, in a Rails app, you'll want to have separate listings for
|
484
|
-
Models, Controllers, Helpers, and Libs. Group definition works similarly to Filters (and also accepts custom
|
485
|
-
filter classes), but source files end up in a group when the filter passes (returns true), as opposed to filtering
|
486
|
-
results, which exclude files from results when the filter results in a true value.
|
487
|
-
|
488
|
-
Add your groups with:
|
489
|
-
|
490
|
-
```ruby
|
491
|
-
SimpleCov.start do
|
492
|
-
add_group "Models", "app/models"
|
493
|
-
add_group "Controllers", "app/controllers"
|
494
|
-
add_group "Long files" do |src_file|
|
495
|
-
src_file.lines.count > 100
|
496
|
-
end
|
497
|
-
add_group "Multiple Files", ["app/models", "app/controllers"] # You can also pass in an array
|
498
|
-
add_group "Short files", LineFilter.new(5) # Using the LineFilter class defined in Filters section above
|
499
|
-
end
|
500
|
-
```
|
501
|
-
|
502
|
-
## Merging results
|
503
|
-
|
504
|
-
You normally want to have your coverage analyzed across ALL of your test suites, right?
|
505
|
-
|
506
|
-
Simplecov automatically caches coverage results in your
|
507
|
-
(coverage_path)/.resultset.json, and will merge or override those with
|
508
|
-
subsequent runs, depending on whether simplecov considers those subsequent runs
|
509
|
-
as different test suites or as the same test suite as the cached results. To
|
510
|
-
make this distinction, simplecov has the concept of "test suite names".
|
511
|
-
|
512
|
-
### Test suite names
|
513
|
-
|
514
|
-
SimpleCov tries to guess the name of the currently running test suite based upon the shell command the tests
|
515
|
-
are running on. This should work fine for Unit Tests, RSpec, and Cucumber. If it fails, it will use the shell
|
516
|
-
command that invoked the test suite as a command name.
|
517
|
-
|
518
|
-
If you have some non-standard setup and still want nicely labeled test suites, you have to give Simplecov a
|
519
|
-
cue as to what the name of the currently running test suite is. You can do so by specifying
|
520
|
-
`SimpleCov.command_name` in one test file that is part of your specific suite.
|
521
|
-
|
522
|
-
To customize the suite names on a Rails app (yeah, sorry for being Rails-biased, but everyone knows what
|
523
|
-
the structure of those projects is. You can apply this accordingly to the RSpecs in your
|
524
|
-
Outlook-WebDAV-Calendar-Sync gem), you could do something like this:
|
525
|
-
|
526
|
-
```ruby
|
527
|
-
# test/unit/some_test.rb
|
528
|
-
SimpleCov.command_name 'test:units'
|
529
|
-
|
530
|
-
# test/functionals/some_controller_test.rb
|
531
|
-
SimpleCov.command_name "test:functionals"
|
532
|
-
|
533
|
-
# test/integration/some_integration_test.rb
|
534
|
-
SimpleCov.command_name "test:integration"
|
535
|
-
|
536
|
-
# features/support/env.rb
|
537
|
-
SimpleCov.command_name "features"
|
538
|
-
```
|
539
|
-
|
540
|
-
Note that this only has to be invoked ONCE PER TEST SUITE, so even if you have 200 unit test files,
|
541
|
-
specifying it in `some_test.rb` is enough.
|
542
|
-
|
543
|
-
Last but not least **if multiple suites resolve to the same `command_name`** be aware that the coverage results **will
|
544
|
-
clobber each other instead of being merged**. SimpleCov is smart enough to detect unique names for the most common
|
545
|
-
setups, but if you have more than one test suite that doesn't follow a common pattern then you will want to manually
|
546
|
-
ensure that each suite gets a unique `command_name`.
|
547
|
-
|
548
|
-
If you are running tests in parallel each process has the potential to clobber results from the other test processes.
|
549
|
-
If you are relying on the default `command_name` then SimpleCov will attempt to detect and avoid parallel test suite
|
550
|
-
`command_name` collisions based on the presence of `ENV['PARALLEL_TEST_GROUPS']` and `ENV['TEST_ENV_NUMBER']`. If your
|
551
|
-
parallel test runner does not set one or both of these then *you must* set a `command_name` and ensure that it is unique
|
552
|
-
per process (eg. `command_name "Unit Tests PID #{$$}"`).
|
553
|
-
|
554
|
-
If you are using parallel_tests, you must incorporate `TEST_ENV_NUMBER` into the command name yourself, in
|
555
|
-
order for SimpleCov to merge the results correctly. For example:
|
556
|
-
|
557
|
-
```ruby
|
558
|
-
# spec/spec_helper.rb
|
559
|
-
SimpleCov.command_name "features" + (ENV['TEST_ENV_NUMBER'] || '')
|
560
|
-
```
|
561
|
-
|
562
|
-
[simplecov-html] prints the used test suites in the footer of the generated coverage report.
|
563
|
-
|
564
|
-
|
565
|
-
### Merging test runs under the same execution environment
|
566
|
-
|
567
|
-
Test results are automatically merged with previous runs in the same execution
|
568
|
-
environment when generating the result, so when coverage is set up properly for
|
569
|
-
Cucumber and your unit / functional / integration tests, all of those test
|
570
|
-
suites will be taken into account when building the coverage report.
|
571
|
-
|
572
|
-
#### Timeout for merge
|
573
|
-
|
574
|
-
Of course, your cached coverage data is likely to become invalid at some point. Thus, when automatically merging
|
575
|
-
subsequent test runs, result sets that are older than `SimpleCov.merge_timeout` will not be used any more. By default,
|
576
|
-
the timeout is 600 seconds (10 minutes), and you can raise (or lower) it by specifying `SimpleCov.merge_timeout 3600`
|
577
|
-
(1 hour), or, inside a configure/start block, with just `merge_timeout 3600`.
|
578
|
-
|
579
|
-
You can deactivate this automatic merging altogether with `SimpleCov.use_merging false`.
|
580
|
-
|
581
|
-
### Merging test runs under different execution environments
|
582
|
-
|
583
|
-
If your tests are done in parallel across multiple build machines, you can fetch them all and merge them into a single
|
584
|
-
result set using the `SimpleCov.collate` method. This can be added to a Rakefile or script file, having downloaded a set of
|
585
|
-
`.resultset.json` files from each parallel test run.
|
586
|
-
|
587
|
-
```ruby
|
588
|
-
# lib/tasks/coverage_report.rake
|
589
|
-
namespace :coverage do
|
590
|
-
desc "Collates all result sets generated by the different test runners"
|
591
|
-
task :report do
|
592
|
-
require 'simplecov'
|
593
|
-
|
594
|
-
SimpleCov.collate Dir["simplecov-resultset-*/.resultset.json"]
|
595
|
-
end
|
596
|
-
end
|
597
|
-
```
|
598
|
-
|
599
|
-
`SimpleCov.collate` also takes an optional simplecov profile and an optional
|
600
|
-
block for configuration, just the same as `SimpleCov.start` or
|
601
|
-
`SimpleCov.configure`. This means you can configure a separate formatter for
|
602
|
-
the collated output. For instance, you can make the formatter in
|
603
|
-
`SimpleCov.start` the `SimpleCov::Formatter::SimpleFormatter`, and only use more
|
604
|
-
complex formatters in the final `SimpleCov.collate` run.
|
605
|
-
|
606
|
-
```ruby
|
607
|
-
# spec/spec_helper.rb
|
608
|
-
require 'simplecov'
|
609
|
-
|
610
|
-
SimpleCov.start 'rails' do
|
611
|
-
# Disambiguates individual test runs
|
612
|
-
command_name "Job #{ENV["TEST_ENV_NUMBER"]}" if ENV["TEST_ENV_NUMBER"]
|
613
|
-
|
614
|
-
if ENV['CI']
|
615
|
-
formatter SimpleCov::Formatter::SimpleFormatter
|
616
|
-
else
|
617
|
-
formatter SimpleCov::Formatter::MultiFormatter.new([
|
618
|
-
SimpleCov::Formatter::SimpleFormatter,
|
619
|
-
SimpleCov::Formatter::HTMLFormatter
|
620
|
-
])
|
621
|
-
end
|
622
|
-
|
623
|
-
track_files "**/*.rb"
|
624
|
-
end
|
625
|
-
```
|
626
|
-
|
627
|
-
```ruby
|
628
|
-
# lib/tasks/coverage_report.rake
|
629
|
-
namespace :coverage do
|
630
|
-
task :report do
|
631
|
-
require 'simplecov'
|
632
|
-
|
633
|
-
SimpleCov.collate Dir["simplecov-resultset-*/.resultset.json"], 'rails' do
|
634
|
-
formatter SimpleCov::Formatter::MultiFormatter.new([
|
635
|
-
SimpleCov::Formatter::SimpleFormatter,
|
636
|
-
SimpleCov::Formatter::HTMLFormatter
|
637
|
-
])
|
638
|
-
end
|
639
|
-
end
|
640
|
-
end
|
641
|
-
```
|
642
|
-
|
643
|
-
## Running simplecov against subprocesses
|
644
|
-
|
645
|
-
`SimpleCov.enable_for_subprocesses` will allow SimpleCov to observe subprocesses starting using `Process.fork`.
|
646
|
-
This modifies ruby's core Process.fork method so that SimpleCov can see into it, appending `" (subprocess #{pid})"`
|
647
|
-
to the `SimpleCov.command_name`, with results that can be merged together using SimpleCov's merging feature.
|
648
|
-
|
649
|
-
To configure this, use `.at_fork`.
|
650
|
-
|
651
|
-
```ruby
|
652
|
-
SimpleCov.enable_for_subprocesses true
|
653
|
-
SimpleCov.at_fork do |pid|
|
654
|
-
# This needs a unique name so it won't be ovewritten
|
655
|
-
SimpleCov.command_name "#{SimpleCov.command_name} (subprocess: #{pid})"
|
656
|
-
# be quiet, the parent process will be in charge of output and checking coverage totals
|
657
|
-
SimpleCov.print_error_status = false
|
658
|
-
SimpleCov.formatter SimpleCov::Formatter::SimpleFormatter
|
659
|
-
SimpleCov.minimum_coverage 0
|
660
|
-
# start
|
661
|
-
SimpleCov.start
|
662
|
-
end
|
663
|
-
```
|
664
|
-
|
665
|
-
NOTE: SimpleCov must have already been started before `Process.fork` was called.
|
666
|
-
|
667
|
-
### Running simplecov against spawned subprocesses
|
668
|
-
|
669
|
-
Perhaps you're testing a ruby script with `PTY.spawn` or `Open3.popen`, or `Process.spawn` or etc.
|
670
|
-
SimpleCov can cover this too.
|
671
|
-
|
672
|
-
Add a .simplecov_spawn.rb file to your project root
|
673
|
-
```ruby
|
674
|
-
# .simplecov_spawn.rb
|
675
|
-
require 'simplecov' # this will also pick up whatever config is in .simplecov
|
676
|
-
# so ensure it just contains configuration, and doesn't call SimpleCov.start.
|
677
|
-
SimpleCov.command_name 'spawn' # As this is not for a test runner directly, script doesn't have a pre-defined base command_name
|
678
|
-
SimpleCov.at_fork.call(Process.pid) # Use the per-process setup described previously
|
679
|
-
SimpleCov.start # only now can we start.
|
680
|
-
```
|
681
|
-
Then, instead of calling your script directly, like:
|
682
|
-
```ruby
|
683
|
-
PTY.spawn('my_script.rb') do # ...
|
684
|
-
```
|
685
|
-
Use bin/ruby to require the new .simplecov_spawn file, then your script
|
686
|
-
```ruby
|
687
|
-
PTY.spawn('ruby -r./.simplecov_spawn my_script.rb') do # ...
|
688
|
-
```
|
689
|
-
|
690
|
-
## Running coverage only on demand
|
691
|
-
|
692
|
-
The Ruby STDLIB Coverage library that SimpleCov builds upon is *very* fast (on a ~10 min Rails test suite, the speed
|
693
|
-
drop was only a couple seconds for me), and therefore it's SimpleCov's policy to just generate coverage every time you
|
694
|
-
run your tests because it doesn't do your test speed any harm and you're always equipped with the latest and greatest
|
695
|
-
coverage results.
|
696
|
-
|
697
|
-
Because of this, SimpleCov has no explicit built-in mechanism to run coverage only on demand.
|
698
|
-
|
699
|
-
However, you can still accomplish this very easily by introducing an ENV variable conditional into your SimpleCov setup
|
700
|
-
block, like this:
|
701
|
-
|
702
|
-
```ruby
|
703
|
-
SimpleCov.start if ENV["COVERAGE"]
|
704
|
-
```
|
705
|
-
|
706
|
-
Then, SimpleCov will only run if you execute your tests like this:
|
707
|
-
|
708
|
-
```shell
|
709
|
-
COVERAGE=true rake test
|
710
|
-
```
|
711
|
-
|
712
|
-
## Errors and exit statuses
|
713
|
-
|
714
|
-
To aid in debugging issues, if an error is raised, SimpleCov will print a message to `STDERR`
|
715
|
-
with the exit status of the error, like:
|
716
|
-
|
717
|
-
```
|
718
|
-
SimpleCov failed with exit 1
|
719
|
-
```
|
720
|
-
|
721
|
-
This `STDERR` message can be disabled with:
|
722
|
-
|
723
|
-
```
|
724
|
-
SimpleCov.print_error_status = false
|
725
|
-
```
|
726
|
-
|
727
|
-
## Profiles
|
728
|
-
|
729
|
-
By default, SimpleCov's only config assumption is that you only want coverage reports for files inside your project
|
730
|
-
root. To save yourself from repetitive configuration, you can use predefined blocks of configuration, called 'profiles',
|
731
|
-
or define your own.
|
732
|
-
|
733
|
-
You can then pass the name of the profile to be used as the first argument to SimpleCov.start. For example, simplecov
|
734
|
-
comes bundled with a 'rails' profile. It looks somewhat like this:
|
735
|
-
|
736
|
-
```ruby
|
737
|
-
SimpleCov.profiles.define 'rails' do
|
738
|
-
add_filter '/test/'
|
739
|
-
add_filter '/config/'
|
740
|
-
|
741
|
-
add_group 'Controllers', 'app/controllers'
|
742
|
-
add_group 'Models', 'app/models'
|
743
|
-
add_group 'Helpers', 'app/helpers'
|
744
|
-
add_group 'Libraries', 'lib'
|
745
|
-
end
|
746
|
-
```
|
747
|
-
|
748
|
-
As you can see, it's just a SimpleCov.configure block. In your test_helper.rb, launch SimpleCov with:
|
749
|
-
|
750
|
-
```ruby
|
751
|
-
SimpleCov.start 'rails'
|
752
|
-
```
|
753
|
-
|
754
|
-
or
|
755
|
-
|
756
|
-
```ruby
|
757
|
-
SimpleCov.start 'rails' do
|
758
|
-
# additional config here
|
759
|
-
end
|
760
|
-
```
|
761
|
-
|
762
|
-
### Custom profiles
|
763
|
-
|
764
|
-
You can load additional profiles with the SimpleCov.load_profile('xyz') method. This allows you to build upon an
|
765
|
-
existing profile and customize it so you can reuse it in unit tests and Cucumber features. For example:
|
766
|
-
|
767
|
-
```ruby
|
768
|
-
# lib/simplecov_custom_profile.rb
|
769
|
-
require 'simplecov'
|
770
|
-
SimpleCov.profiles.define 'myprofile' do
|
771
|
-
load_profile 'rails'
|
772
|
-
add_filter 'vendor' # Don't include vendored stuff
|
773
|
-
end
|
774
|
-
|
775
|
-
# features/support/env.rb
|
776
|
-
require 'simplecov_custom_profile'
|
777
|
-
SimpleCov.start 'myprofile'
|
778
|
-
|
779
|
-
# test/test_helper.rb
|
780
|
-
require 'simplecov_custom_profile'
|
781
|
-
SimpleCov.start 'myprofile'
|
782
|
-
```
|
783
|
-
|
784
|
-
## Customizing exit behaviour
|
785
|
-
|
786
|
-
You can define what SimpleCov should do when your test suite finishes by customizing the at_exit hook:
|
787
|
-
|
788
|
-
```ruby
|
789
|
-
SimpleCov.at_exit do
|
790
|
-
SimpleCov.result.format!
|
791
|
-
end
|
792
|
-
```
|
793
|
-
|
794
|
-
Above is the default behaviour. Do whatever you like instead!
|
795
|
-
|
796
|
-
### Minimum coverage
|
797
|
-
|
798
|
-
You can define the minimum coverage percentage expected. SimpleCov will return non-zero if unmet.
|
799
|
-
|
800
|
-
```ruby
|
801
|
-
SimpleCov.minimum_coverage 90
|
802
|
-
# same as above (the default is to check line coverage)
|
803
|
-
SimpleCov.minimum_coverage line: 90
|
804
|
-
# check for a minimum line coverage of 90% and minimum 80% branch coverage
|
805
|
-
SimpleCov.minimum_coverage line: 90, branch: 80
|
806
|
-
```
|
807
|
-
|
808
|
-
### Minimum coverage by file
|
809
|
-
|
810
|
-
You can define the minimum coverage by file percentage expected. SimpleCov will return non-zero if unmet. This is useful
|
811
|
-
to help ensure coverage is relatively consistent, rather than being skewed by particularly good or bad areas of the code.
|
812
|
-
|
813
|
-
```ruby
|
814
|
-
SimpleCov.minimum_coverage_by_file 80
|
815
|
-
# same as above (the default is to check line coverage by file)
|
816
|
-
SimpleCov.minimum_coverage_by_file line: 80
|
817
|
-
# check for a minimum line coverage by file of 90% and minimum 80% branch coverage
|
818
|
-
SimpleCov.minimum_coverage_by_file line: 90, branch: 80
|
819
|
-
```
|
820
|
-
|
821
|
-
### Maximum coverage drop
|
822
|
-
|
823
|
-
You can define the maximum coverage drop percentage at once. SimpleCov will return non-zero if exceeded.
|
824
|
-
|
825
|
-
```ruby
|
826
|
-
SimpleCov.maximum_coverage_drop 5
|
827
|
-
# same as above (the default is to check line drop)
|
828
|
-
SimpleCov.maximum_coverage_drop line: 5
|
829
|
-
# check for a maximum line drop of 5% and maximum 10% branch drop
|
830
|
-
SimpleCov.maximum_coverage_drop line: 5, branch: 10
|
831
|
-
```
|
832
|
-
|
833
|
-
### Refuse dropping coverage
|
834
|
-
|
835
|
-
You can also entirely refuse dropping coverage between test runs:
|
836
|
-
|
837
|
-
```ruby
|
838
|
-
SimpleCov.refuse_coverage_drop
|
839
|
-
# same as above (the default is to only refuse line drop)
|
840
|
-
SimpleCov.refuse_coverage_drop :line
|
841
|
-
# refuse drop for line and branch
|
842
|
-
SimpleCov.refuse_coverage_drop :line, :branch
|
843
|
-
```
|
844
|
-
|
845
|
-
## Using your own formatter
|
846
|
-
|
847
|
-
You can use your own formatter with:
|
848
|
-
|
849
|
-
```ruby
|
850
|
-
SimpleCov.formatter = SimpleCov::Formatter::HTMLFormatter
|
851
|
-
```
|
852
|
-
|
853
|
-
Calling `SimpleCov.result.format!` will be invoked with `SimpleCov::Formatter::YourFormatter.new.format(result)`,
|
854
|
-
and `result` is an instance of `SimpleCov::Result`. Do whatever your wish with that!
|
855
|
-
|
856
|
-
|
857
|
-
## Using multiple formatters
|
858
|
-
|
859
|
-
As of SimpleCov 0.9, you can specify multiple result formats. Formatters besides the default HTML formatter require separate gems, however.
|
860
|
-
|
861
|
-
```ruby
|
862
|
-
require "simplecov-html"
|
863
|
-
|
864
|
-
SimpleCov.formatters = SimpleCov::Formatter::MultiFormatter.new([
|
865
|
-
SimpleCov::Formatter::HTMLFormatter,
|
866
|
-
SimpleCov::Formatter::CSVFormatter,
|
867
|
-
])
|
868
|
-
```
|
869
|
-
|
870
|
-
## JSON formatter
|
871
|
-
|
872
|
-
SimpleCov is packaged with a separate gem called [simplecov_json_formatter](https://github.com/codeclimate-community/simplecov_json_formatter) that provides you with a JSON formatter, this formatter could be useful for different use cases, such as for CI consumption or for reporting to external services.
|
873
|
-
|
874
|
-
In order to use it you will need to manually load the installed gem like so:
|
875
|
-
|
876
|
-
```ruby
|
877
|
-
require "simplecov_json_formatter"
|
878
|
-
SimpleCov.formatter = SimpleCov::Formatter::JSONFormatter
|
879
|
-
```
|
880
|
-
|
881
|
-
> _Note:_ In case you plan to report your coverage results to CodeClimate services, know that SimpleCov will automatically use the
|
882
|
-
> JSON formatter along with the HTML formatter when the `CC_TEST_REPORTER_ID` variable is present in the environment.
|
883
|
-
|
884
|
-
## Available formatters, editor integrations and hosted services
|
885
|
-
|
886
|
-
* [Open Source formatter and integration plugins for SimpleCov](doc/alternate-formatters.md)
|
887
|
-
* [Editor Integration](doc/editor-integration.md)
|
888
|
-
* [Hosted (commercial) services](doc/commercial-services.md)
|
889
|
-
|
890
|
-
## Ruby version compatibility
|
891
|
-
|
892
|
-
SimpleCov is built in [Continuous Integration] on Ruby 2.7+ as well as JRuby 9.3+.
|
893
|
-
|
894
|
-
Note for JRuby => You need to pass JRUBY_OPTS="--debug" or create .jrubyrc and add debug.fullTrace=true
|
895
|
-
|
896
|
-
## Want to find dead code in production?
|
897
|
-
|
898
|
-
Try [Coverband](https://github.com/danmayer/coverband).
|
899
|
-
|
900
|
-
## Want to use Spring with SimpleCov?
|
901
|
-
|
902
|
-
If you're using [Spring](https://github.com/rails/spring) to speed up test suite runs and want to run SimpleCov along
|
903
|
-
with them, you'll find that it often misreports coverage with the default config due to some sort of eager loading
|
904
|
-
issue. Don't despair!
|
905
|
-
|
906
|
-
One solution is to [explicitly call eager
|
907
|
-
load](https://github.com/simplecov-ruby/simplecov/issues/381#issuecomment-347651728)
|
908
|
-
in your `test_helper.rb` / `spec_helper.rb` after calling `SimpleCov.start`.
|
909
|
-
|
910
|
-
```ruby
|
911
|
-
require 'simplecov'
|
912
|
-
SimpleCov.start 'rails'
|
913
|
-
Rails.application.eager_load!
|
914
|
-
```
|
915
|
-
|
916
|
-
Alternatively, you could disable Spring while running SimpleCov:
|
917
|
-
|
918
|
-
```
|
919
|
-
DISABLE_SPRING=1 rake test
|
920
|
-
```
|
921
|
-
|
922
|
-
Or you could remove `gem 'spring'` from your `Gemfile`.
|
923
|
-
|
924
|
-
## Troubleshooting
|
925
|
-
|
926
|
-
The **most common problem is that simplecov isn't required and started before everything else**. In order to track
|
927
|
-
coverage for your whole application **simplecov needs to be the first one** so that it (and the underlying coverage
|
928
|
-
library) can subsequently track loaded files and their usage.
|
929
|
-
|
930
|
-
If you are missing coverage for some code a simple trick is to put a puts statement in there and right after
|
931
|
-
`SimpleCov.start` so you can see if the file really was loaded after simplecov was started.
|
932
|
-
|
933
|
-
```ruby
|
934
|
-
# my_code.rb
|
935
|
-
class MyCode
|
936
|
-
|
937
|
-
puts "MyCode is being loaded!"
|
938
|
-
|
939
|
-
def my_method
|
940
|
-
# ...
|
941
|
-
end
|
942
|
-
end
|
943
|
-
|
944
|
-
# spec_helper.rb/rails_helper.rb/test_helper.rb/.simplecov whatever
|
945
|
-
|
946
|
-
SimpleCov.start
|
947
|
-
puts "SimpleCov started successfully!"
|
948
|
-
```
|
949
|
-
|
950
|
-
Now when you run your test suite and you see:
|
951
|
-
|
952
|
-
```
|
953
|
-
SimpleCov started successfully!
|
954
|
-
MyCode is being loaded!
|
955
|
-
```
|
956
|
-
|
957
|
-
then it's good otherwise you likely have a problem :)
|
958
|
-
|
959
|
-
## Code of Conduct
|
960
|
-
|
961
|
-
Everyone participating in this project's development, issue trackers and other channels is expected to follow our
|
962
|
-
[Code of Conduct](./CODE_OF_CONDUCT.md)
|
963
|
-
|
964
|
-
## Contributing
|
965
|
-
|
966
|
-
See the [contributing guide](https://github.com/simplecov-ruby/simplecov/blob/main/CONTRIBUTING.md).
|
967
|
-
|
968
|
-
## Kudos
|
969
|
-
|
970
|
-
Thanks to Aaron Patterson for the original idea for this!
|
971
|
-
|
972
|
-
## Copyright
|
973
|
-
|
974
|
-
Copyright (c) 2010-2017 Christoph Olszowka. See MIT-LICENSE for details.
|