Skip to content

RSpec LOC don't contribute to rails stats #2862

@CuddlyBunion341

Description

@CuddlyBunion341

What Ruby, Rails and RSpec versions are you using?

Ruby version: 3.4.3
Rails version: 8.0.2
RSpec version: 3.13.5

Observed behaviour

When running bin/rails stats the rspec tests are not included in the report:

bin/rails stats
+----------------------+--------+--------+---------+---------+-----+-------+
| Name                 |  Lines |    LOC | Classes | Methods | M/C | LOC/M |
+----------------------+--------+--------+---------+---------+-----+-------+
| Controllers          |    818 |    634 |      18 |      94 |   5 |     4 |
| Helpers              |     97 |     72 |       0 |      13 |   0 |     3 |
| Jobs                 |      9 |      2 |       1 |       0 |   0 |     0 |
| Models               |    800 |    595 |      25 |      49 |   1 |    10 |
| Mailers              |     16 |     12 |       2 |       1 |   0 |    10 |
| Channels             |     22 |     16 |       1 |       2 |   2 |     6 |
| Views                |   2488 |   2155 |       0 |       1 |   0 |  2153 |
| Stylesheets          |   1359 |   1125 |       0 |       0 |   0 |     0 |
| JavaScript           |    428 |    342 |       0 |       0 |   0 |     0 |
| Libraries            |     40 |     34 |       0 |       0 |   0 |     0 |
+----------------------+--------+--------+---------+---------+-----+-------+
| Total                |   6077 |   4987 |      47 |     160 |   3 |    29 |
+----------------------+--------+--------+---------+---------+-----+-------+
  Code LOC: 4987     Test LOC: 0     Code to Test Ratio: 1:0.0

I'd expect rspec to be handled in the code statistics calculator

Expected behaviour

I'd expect the Test LOC to be present as well as the correct ratio and test groups such as Model Tests.

Can you provide an example reproduction?

Todo

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions