Sha256: c093409ff1b978559d1577f147f84b258724d9fb087ffb2107785b0025d2651d

Contents?: true

Size: 1.33 KB

Versions: 50

Compression:

Stored size: 1.33 KB

Contents

@rspec
Feature: Sophisticated grouping and filtering on RSpec

  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 RSpec 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_group 'By array', ['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 =~ /describe/ } }
        add_filter {|src_file| src_file.covered_percent < 100 }
      end
      """

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

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

Version data entries

50 entries across 50 versions & 14 rubygems

Version Path
dirwatch-0.0.9 vendor/bundle/ruby/2.5.0/gems/simplecov-0.13.0/features/rspec_groups_and_filters_complex.feature
dirwatch-0.0.8 vendor/bundle/ruby/2.5.0/gems/simplecov-0.13.0/features/rspec_groups_and_filters_complex.feature
tdiary-5.0.9 vendor/bundle/gems/simplecov-0.14.1/features/rspec_groups_and_filters_complex.feature
dirwatch-0.0.6 vendor/bundle/ruby/2.3.0/gems/simplecov-0.13.0/features/rspec_groups_and_filters_complex.feature
dirwatch-0.0.5 vendor/bundle/ruby/2.3.0/gems/simplecov-0.13.0/features/rspec_groups_and_filters_complex.feature
dirwatch-0.0.4 vendor/bundle/ruby/2.3.0/gems/simplecov-0.13.0/features/rspec_groups_and_filters_complex.feature
dirwatch-0.0.3 vendor/bundle/ruby/2.3.0/gems/simplecov-0.13.0/features/rspec_groups_and_filters_complex.feature
dirwatch-0.0.2 vendor/bundle/ruby/2.3.0/gems/simplecov-0.13.0/features/rspec_groups_and_filters_complex.feature
simplecov-0.15.1 features/rspec_groups_and_filters_complex.feature
simplecov-0.15.0 features/rspec_groups_and_filters_complex.feature
logstash-filter-cache-redis-0.3.1 vendor/bundle/jruby/1.9/gems/simplecov-0.14.1/features/rspec_groups_and_filters_complex.feature
logstash-filter-cache-redis-0.3.0 vendor/bundle/jruby/1.9/gems/simplecov-0.14.1/features/rspec_groups_and_filters_complex.feature
logstash-filter-cache-redis-0.2.0 vendor/bundle/jruby/1.9/gems/simplecov-0.14.1/features/rspec_groups_and_filters_complex.feature
logstash-filter-cache-redis-0.1.0 vendor/bundle/jruby/1.9/gems/simplecov-0.14.1/features/rspec_groups_and_filters_complex.feature
enju_leaf-1.2.1 vendor/bundle/ruby/2.3/gems/simplecov-0.14.1/features/rspec_groups_and_filters_complex.feature
simplecov-patched-0.14.3 features/rspec_groups_and_filters_complex.feature
simplecov-patched-0.14.2 features/rspec_groups_and_filters_complex.feature
simplecov-0.14.1 features/rspec_groups_and_filters_complex.feature
simplecov-0.14.0 features/rspec_groups_and_filters_complex.feature
simplecov-0.13.0 features/rspec_groups_and_filters_complex.feature