[Bug Report]
crystal-williams-brown opened this issue · 2 comments
Description
I'm attempting to modularize a Rails app. I am starting with one section. I moved the files into a single folder. I installed packwerk and packs-rails. I placed the folder with the files inside of a packs folder at the root of the app. I moved the test files into an rspec folder inside of the section folder. My test fail with the error NameError: uninitialized constant for every single class. All of these classes are in the folder. I don't know why the tests are not treating them like classes.
To Reproduce
- move class files into a folder within the packs folder
- Add a package.yml turn on engine setting
- Add test files and tell rspec to include packs-rails
- Run tests and watch them fail
Expected Behaviour
I expected the tests to still recognize the class names though they are moved into a pack.
Screenshots
This is the package.yml in the pack folder
And here is the one at the root
Here is one of the failing tests
Version Information
- Packwerk: 3.0.1
- Ruby 3.2.2
Additional Context
I've tried directly requiring packwerk in the files, having the test files specify they are model tests, moving files around, and changing the names of classes. I've also started over from scratch, following the guidance in the instructions and using different tutorials.
This is probably an issue on packs. Packwerk doesn't do anything to load code. It is a static analysis tool. Could you please open an issue there?
Sorry, I moved it to packs-rails rubyatscale/packs-rails#64