Sha256: a35d62c35645b274791c9d9807e03bc280fbea7a7fbc0d23638155a4c00e67e9

Contents?: true

Size: 1.25 KB

Versions: 128

Compression:

Stored size: 1.25 KB

Contents

@test_unit
Feature: Sophisticated grouping and filtering on Test/Unit

  Defining groups and filters can be done by passing blocks or strings.
  Blocks get each SimpleCov::SourceFile instance passed an can use arbitrary
  and potentially weird conditions to remove files from the report or add them
  to specific groups.

  Scenario:
    Given SimpleCov for Test/Unit is configured with:
      """
      require 'simplecov'
      SimpleCov.start do
        add_group 'By block' do |src_file|
          src_file.filename =~ /MaGiC/i
        end
        add_group 'By string', 'project/meta_magic'

        add_filter 'faked_project.rb'
        # Remove all files that include "describe" in their source
        add_filter {|src_file| src_file.lines.any? {|line| line.src =~ /TestCase/ } }
        add_filter {|src_file| src_file.covered_percent < 100 }
      end
      """

    When I open the coverage report generated with `bundle exec rake test`
    Then I should see the groups:
      | name      | coverage | files |
      | All Files | 100.0%   | 1     |
      | By block  | 100.0%   | 1     |
      | By string | 100.0%   | 1     |

    And I should see the source files:
      | name                            | coverage |
      | lib/faked_project/meta_magic.rb | 100.0 %  |

Version data entries

128 entries across 112 versions & 19 rubygems

Version Path
dirwatch-0.0.9 vendor/bundle/ruby/2.5.0/gems/simplecov-0.13.0/features/test_unit_groups_and_filters_complex.feature
dirwatch-0.0.8 vendor/bundle/ruby/2.5.0/gems/simplecov-0.13.0/features/test_unit_groups_and_filters_complex.feature
tdiary-5.0.9 vendor/bundle/gems/simplecov-0.14.1/features/test_unit_groups_and_filters_complex.feature
tdiary-5.0.8 vendor/bundle/gems/tdiary-5.0.7/vendor/bundle/gems/simplecov-0.9.2/features/test_unit_groups_and_filters_complex.feature
tdiary-5.0.7 vendor/bundle/gems/simplecov-0.9.2/features/test_unit_groups_and_filters_complex.feature
dirwatch-0.0.6 vendor/bundle/ruby/2.3.0/gems/simplecov-0.13.0/features/test_unit_groups_and_filters_complex.feature
dirwatch-0.0.5 vendor/bundle/ruby/2.3.0/gems/simplecov-0.13.0/features/test_unit_groups_and_filters_complex.feature
dirwatch-0.0.4 vendor/bundle/ruby/2.3.0/gems/simplecov-0.13.0/features/test_unit_groups_and_filters_complex.feature
dirwatch-0.0.3 vendor/bundle/ruby/2.3.0/gems/simplecov-0.13.0/features/test_unit_groups_and_filters_complex.feature
dirwatch-0.0.2 vendor/bundle/ruby/2.3.0/gems/simplecov-0.13.0/features/test_unit_groups_and_filters_complex.feature
tdiary-5.0.6 vendor/bundle/gems/simplecov-0.9.2/features/test_unit_groups_and_filters_complex.feature
simplecov-0.15.1 features/test_unit_groups_and_filters_complex.feature
simplecov-0.15.0 features/test_unit_groups_and_filters_complex.feature
logstash-filter-cache-redis-0.3.1 vendor/bundle/jruby/1.9/gems/simplecov-0.14.1/features/test_unit_groups_and_filters_complex.feature
logstash-filter-cache-redis-0.3.0 vendor/bundle/jruby/1.9/gems/simplecov-0.14.1/features/test_unit_groups_and_filters_complex.feature
logstash-filter-cache-redis-0.2.0 vendor/bundle/jruby/1.9/gems/simplecov-0.14.1/features/test_unit_groups_and_filters_complex.feature
logstash-filter-cache-redis-0.1.0 vendor/bundle/jruby/1.9/gems/simplecov-0.14.1/features/test_unit_groups_and_filters_complex.feature
tdiary-5.0.5 vendor/bundle/gems/simplecov-0.9.2/features/test_unit_groups_and_filters_complex.feature
tdiary-5.0.5 vendor/bundle/gems/tdiary-5.0.4/vendor/bundle/gems/simplecov-0.9.2/features/test_unit_groups_and_filters_complex.feature
enju_leaf-1.2.1 vendor/bundle/ruby/2.3/gems/simplecov-0.14.1/features/test_unit_groups_and_filters_complex.feature