This project is archived and is in readonly mode.
Rails 3.0 generator inconsistency
-
Rob Zolkos
I can confirm this behaviour.
I agree that if a rails app is created with the -T option then the following should be injected into application.rb
config.generators do |g| g.test_framework nil endThen subsequent generators won't generate any test files.
-
Ryan Bigg
- State changed from new to incomplete
- Importance changed from to Low
Please submit a patch to fix this issue, along with tests.
-
manu
Why is this marked as incomplete? What else do you need? I can also show you how cucumber rails totally breaks in this case.
-
Aditya Sanghi
The ticket is marked incomplete while it is awaiting patches to fix the problem. Feel free to submit a patch. If you dont want to or cant for some reason, let me know. Someone else might pick up the challenge.
-
Rob Zolkos
I'll have a swing at writing a patch. Before I do, is there any existing design decision that was made that causes rails generators to create test files if the rails app was created with -T, or is it a bug that needs fixing?
-
Rob Zolkos
Attached is patch and tests.
if rails app is created with -T or --skip-test-unit then the application.rb will contain
config.generators do |g|
g.test_framework nil endwhich will then mean that any future generators will not generate any test files.
-
Elad Meidar
Verified and Patch is working on stable,
Just one thing: the patch adds aconfig.generatorsblock, isn't there anything else that adds this block already and might cause more than 1 to appear in the final output? -
Rob Zolkos
I searched through the source today and couldn't find anything else or anywhere else that adds this block into application.rb
-
Ryan Bigg
Automatic cleanup of spam.
-
Aditya Sanghi
- State changed from incomplete to verified
- Milestone set to 3.x
- Assigned user set to José Valim
-
José Valim
It looks good, I will apply it during the next weeks. Anyone in mood for supplying a similar patch to ActiveRecord? If so, you can use add "config.generators.orm false" to config/application.rb instead of giving a block.
Similarly, the previous patch could be using "config.generators.test_framework false", but I will handle that.
-
Aditya Sanghi
- Tag set to appgenerator, patch, railties
Adding patch to add
config.generators.orm = falsewhen skip active_record is given as per José's suggestion above. -
Rob Zolkos
And here is patch to add config.generators.test_framework = false when skip_test_unit is given.
That should save you some precious time José :)
-
Rob Zolkos
And here is the patch.
-
Rob Zolkos
Finally...
-
Repository
- State changed from verified to resolved
(from [bafa1533f414a3d3c02528b774e5cf28e85774b5]) skip testing framework if app created with --skip-test-unit [#5796 Rails 3.0 generator inconsistency state:resolved]
Signed-off-by: José Valim jose.valim@gmail.com
https://github.com/rails/rails/commit/bafa1533f414a3d3c02528b774e5c... -
Aditya Sanghi
José,
There is another patch here that needs to be applied. As per your suggestion above, I added a patch to set config.generators to false if --skip-activerecord option has been provided.
Do you want me to create another ticket for it?
Cheers,
Aditya -
Aditya Sanghi
..and bumping this one as well, gently of course.
-
rails
This issue has been automatically marked as stale because it has not been commented on for at least three months.
The resources of the Rails core team are limited, and so we are asking for your help. If you can still reproduce this error on the 3-0-stable branch or on master, please reply with all of the information you have about it and add "[state:open]" to your comment. This will reopen the ticket for review. Likewise, if you feel that this is a very important feature for Rails to include, please reply with your explanation so we can consider it.
Thank you for all your contributions, and we hope you will understand this step to focus our efforts where they are most helpful.
-
rails
- State changed from open to stale
