Skip to content

Conversation

@tangposmarvin
Copy link
Contributor

Fixes #2862

The code statistics registration in the Railtie class body uses Dir['./spec/**/*_spec.rb'] which resolves relative to Dir.pwd. When bin/rails stats is run from a directory other than the app root, no spec files are found and the output shows Test LOC: 0.

This moves the registration into an initializer and uses Rails.root.join(...) for absolute path resolution.

@JonRowe
Copy link
Member

JonRowe commented Feb 10, 2026

If you rebase main is now green.

@JonRowe JonRowe merged commit 9edcb51 into rspec:main Feb 11, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

RSpec LOC don't contribute to rails stats

2 participants