Commit fa6321c
Add unit tests for Rails Engine automatic rake task loading
Add comprehensive tests to verify Rails::Engine properly loads rake tasks
from lib/tasks/ without needing explicit rake_tasks block:
1. Verifies engine.rb does NOT have a rake_tasks block
- This prevents duplicate task execution (PR #1770 bug)
- Ensures we rely on Rails::Engine automatic loading
2. Verifies all expected task files exist in lib/tasks/
- assets.rake, generate_packs.rake, locale.rake, doctor.rake
- Confirms files are in the standard location for automatic loading
Update .rubocop.yml to exclude engine_spec.rb from ModuleLength check as
the comprehensive test suite requires many examples to properly validate
Rails::Engine behavior.
These tests catch the duplicate loading bug that occurred in PR #1770
and was fixed in PR #2052. See RAKE_TASK_DUPLICATE_ANALYSIS.md for
complete historical context.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <[email protected]>1 parent 88529af commit fa6321c
2 files changed
+45
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
96 | 96 | | |
97 | 97 | | |
98 | 98 | | |
| 99 | + | |
| 100 | + | |
99 | 101 | | |
100 | 102 | | |
101 | 103 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
220 | 220 | | |
221 | 221 | | |
222 | 222 | | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
223 | 266 | | |
224 | 267 | | |
0 commit comments