File: parallel_tests.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 (69 lines) | stat: -rw-r--r-- 2,407 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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
@rspec @disable-bundler

Feature:

  Parallel tests and its corresponding test project work together with Simplecov
  just fine and they produce the same output like a normal rspec run.

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

  Scenario: Running it through parallel_tests produces the same results as a normal rspec run
    Given I install dependencies
    And SimpleCov for RSpec is configured with:
      """
      require 'simplecov'
      SimpleCov.start
      """
    When I open the coverage report generated with `bundle exec parallel_rspec spec`
    Then I should see the line coverage results for the parallel tests project

  # Note it's better not to test this in the same scenario as before.
  # Merging of results might kick in and ruin this.
  Scenario: Running the project with normal rspec
    Given I install dependencies
    And SimpleCov for RSpec is configured with:
      """
      require 'simplecov'
      SimpleCov.start
      """
    When I open the coverage report generated with `bundle exec rspec spec`
    Then I should see the line coverage results for the parallel tests project

  @branch_coverage
  Scenario: Running the project with normal rspec and branch coverage
    Given I install dependencies
    And SimpleCov for RSpec is configured with:
      """
      require 'simplecov'
      SimpleCov.start do
        enable_coverage :branch
      end
      """
    When I open the coverage report generated with `bundle exec rspec spec`
    Then I should see the branch coverage results for the parallel tests project

  @branch_coverage
  Scenario: Running the project with normal rspec and branch coverage
    Given I install dependencies
    And SimpleCov for RSpec is configured with:
      """
      require 'simplecov'
      SimpleCov.start do
        enable_coverage :branch
      end
      """
    When I open the coverage report generated with `bundle exec parallel_rspec spec`
    Then I should see the branch coverage results for the parallel tests project

  Scenario: Coverage violations aren't printed until the end
    Given I install dependencies
    And SimpleCov for RSpec is configured with:
      """
      require 'simplecov'
      SimpleCov.start do
        minimum_coverage 89
      end
      """
    When I successfully run `bundle exec parallel_rspec spec`
    Then the output should not match /+cover.+below.+minimum/