Sha256: 1c4e8a7e84bd5f56c753b235aa2d246aa367637aa0d5b1daae3c06dc7a5983b3

Contents?: true

Size: 1.53 KB

Versions: 17

Compression:

Stored size: 1.53 KB

Contents

@test_unit
Feature: Grouping on Test/Unit using a custom filter class

  Next to passing a block or a string to define a group, you can also pass
  a filter class. The filter class inherits from SimpleCov::Filter and 
  must implement the matches? method, which is used to determine whether 
  or not a file should be added to the group. 

  Scenario:
    Given SimpleCov for Test/Unit is configured with:
      """
      require 'simplecov'
      class CoverageFilter < SimpleCov::Filter
        def matches?(source_file)
          source_file.covered_percent < filter_argument
        end
      end
      SimpleCov.start do
        add_group 'By filter class', CoverageFilter.new(90)
        add_group 'By string', 'project/meta_magic'
      end
      """

    When I open the coverage report generated with `bundle exec rake test`
    Then I should see the groups:
      | name             | coverage | files |
      | All Files        | 91.38%   | 6     |
      | By filter class  | 78.26%   | 2     |
      | By string        | 100.0%   | 1     |
      | Ungrouped        | 100.0%   | 3     |

    And I should see the source files:
      | name                                    | coverage |
      | lib/faked_project/framework_specific.rb | 75.0 %   | 
      | lib/faked_project/some_class.rb         | 80.0 %   |
      | lib/faked_project.rb                    | 100.0 %  |
      | lib/faked_project/meta_magic.rb         | 100.0 %  |
      | test/meta_magic_test.rb                 | 100.0 %  |
      | test/some_class_test.rb                 | 100.0 %  |

Version data entries

17 entries across 17 versions & 2 rubygems

Version Path
challah-0.6.1 vendor/bundle/gems/simplecov-0.5.4/features/test_unit_groups_using_filter_class.feature
challah-0.6.0 vendor/bundle/gems/simplecov-0.5.4/features/test_unit_groups_using_filter_class.feature
challah-0.5.4 vendor/bundle/gems/simplecov-0.5.4/features/test_unit_groups_using_filter_class.feature
challah-0.5.3 vendor/bundle/gems/simplecov-0.5.4/features/test_unit_groups_using_filter_class.feature
challah-0.5.2 vendor/bundle/gems/simplecov-0.5.4/features/test_unit_groups_using_filter_class.feature
challah-0.5.0 vendor/bundle/gems/simplecov-0.5.4/features/test_unit_groups_using_filter_class.feature
challah-0.4.1 vendor/bundle/gems/simplecov-0.5.4/features/test_unit_groups_using_filter_class.feature
challah-0.4.0 vendor/bundle/gems/simplecov-0.5.4/features/test_unit_groups_using_filter_class.feature
challah-0.3.5 vendor/bundle/gems/simplecov-0.5.4/features/test_unit_groups_using_filter_class.feature
challah-0.3.4 vendor/bundle/gems/simplecov-0.5.4/features/test_unit_groups_using_filter_class.feature
challah-0.3.3 vendor/bundle/gems/simplecov-0.5.4/features/test_unit_groups_using_filter_class.feature
challah-0.3.2 vendor/bundle/gems/simplecov-0.5.4/features/test_unit_groups_using_filter_class.feature
challah-0.3.1 vendor/bundle/gems/simplecov-0.5.4/features/test_unit_groups_using_filter_class.feature
challah-0.3.0 vendor/bundle/gems/simplecov-0.5.4/features/test_unit_groups_using_filter_class.feature
challah-0.2.1 vendor/bundle/gems/simplecov-0.5.4/features/test_unit_groups_using_filter_class.feature
challah-0.2.0 vendor/bundle/gems/simplecov-0.5.4/features/test_unit_groups_using_filter_class.feature
simplecov-0.5.4 features/test_unit_groups_using_filter_class.feature