File: config_enable_for_subprocesses.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 (37 lines) | stat: -rw-r--r-- 1,224 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
@rspec @process_fork

Feature:
  Coverage should include code run by subprocesses

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

  Scenario: Coverage has seen the subprocess line
  When I open the coverage report generated with `bundle exec rspec spec/simple_spec.rb`
  Then I should see the groups:
    | name      | coverage | files |
    | All Files | 100.0%   | 1     |

  Scenario: The at_fork proc
  Given a file named ".simplecov" with:
    """
    SimpleCov.enable_for_subprocesses true
    SimpleCov.command_name "parent process name"
    SimpleCov.at_fork do |_pid|
      SimpleCov.command_name "child process name"
      SimpleCov.start
    end
    """
  When I open the coverage report generated with `bundle exec rspec spec/simple_spec.rb`
  Then I should see the groups:
    | name      | coverage | files |
    | All Files | 100.0%   | 1     |
  And the report should be based upon:
      | child process name  |
      | parent process name |

  Scenario: The documentation on .simplecov_spawn
  When I open the coverage report generated with `bundle exec rspec spec/spawn_spec.rb`
  Then I should see the groups:
    | name      | coverage | files |
    | All Files | 100.0%   | 1     |