ruby-lsp-rails
ruby-lsp-rails copied to clipboard
Investigate how to properly handle in-app engine's tests
Assume an user has a Rails app called my_app, which has in-app engines with the following file structure:
my_app
├── app
├── config
├── (other Rails app folders)
└── engines
└── my_engine
└── test/my_test.rb
Todos
-
[ ] Check what's the official/best practice of running an in-app engine's unit tests
- The Rails engine guide doesn't cover much about writing/running tests.
-
[ ] When opening
my_test.rbfrom themy_appworkspace, the code lens should generate such command:bundle exec bin/rails test engines/my_engine/test/my_test.rbWe need to check if this are expected to work or not.
- If the answer is no, it means tests are expected to be executed under the
my_enginedirectory.
- If the answer is no, it means tests are expected to be executed under the
-
[ ] Is there any other common in-app Rails engine setup we should consider
Can you explain why the current mechanism doesn't work?
We use the absolute path for running tests instead of relative exactly to try to avoid issues with nested projects, so I'm not sure what the problem is.