File: config_autoload.feature

package info (click to toggle)
ruby-simplecov 0.22.0-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,500 kB
  • sloc: ruby: 5,550; makefile: 10
file content (49 lines) | stat: -rw-r--r-- 1,561 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
@test_unit @rspec @config
Feature:

  If you have multiple test suites, it can be a bit cumbersome
  to keep the configuration across them in sync. SimpleCov
  is able to find a config file called '.simplecov' that resides
  in your project's root and will automatically use it when
  loaded.

  This gives you the ability to configure SimpleCov just once
  and then use the same configuration on all test suites simply
  by doing a 'require "simplecov"'

  Background:
    Given I'm working on the project "faked_project"

  Scenario:
    Given a file named ".simplecov" with:
      """
      SimpleCov.start do
        add_filter 'test.rb'
        add_filter 'spec.rb'
      end
      """
    Given SimpleCov for Test/Unit is configured with:
      """
      require 'simplecov'
      """
    Given SimpleCov for RSpec is configured with:
      """
      require 'simplecov'
      """

    When I successfully run `bundle exec rake test`
    And I open the coverage report generated with `bundle exec rspec spec`
    Then the report should be based upon:
      | RSpec      |
      | Unit Tests |

    And I should see the groups:
      | name      | coverage | files |
      | All Files | 90.48%    | 4     |

    And I should see the source files:
      | name                                    | coverage |
      | lib/faked_project.rb                    | 100.00 %  |
      | lib/faked_project/some_class.rb         |  80.00 %  |
      | lib/faked_project/framework_specific.rb |  87.50 %  |
      | lib/faked_project/meta_magic.rb         | 100.00 %  |