This project is archived and is in readonly mode.
Helper test generator
-
Dan Croak
+1
I'm fine with test/helpers or test/unit/helpers.
-
Jack Danger
+1
test/helpers seems to suggest "helpers for tests" akin to test_helper.rb. I'd recommend test/view_helpers for clarity.
-
Ken Collins
+1 for test/helpers. I think it is important for core to establish the convention while lets vendor test assist code like shoulda to work on top of it.
-
Mike Breen
+1
test/unit/helpers works for me.
-
Steven Bristol
+1 for test/helpers.
-
webmat
+1
As for where: what about test/unit/helpers? If it's a unit test, it should be somewhere in unit/...
The 'test/unit/*/_test.rb' glob will support it as it is.
Plus, some of us already split their test helpers in logical files inside /test/helpers/ :-)
-
josh
- Assigned user set to josh
- State changed from new to open
- Milestone cleared.
I've been putting them in test/unit/helpers as well. So lets go with that ;)
That also means we really don't need a separate rake task. So test:helpers can be merged with test:unit since test:unit should run any nested tests.
If you can update the patch, I should be able to get it in before the 2.2 beta release.
-
Eugene Bolshakov
Josh, it makes perfect sense. I've updated the patch so that tests are generated in test/unit/helpers and removed that additional rake task.
I've also had to slightly tweak railties/test/generators/generator_test_helper.rb to make testing of helper generation possible.
Also, there seem to be a problem with Rails::Generators::Commands::Create::class_collisions, but I'll inspect it more and will post results in another ticket.
-
Pratik
I think it's a bit too late for 2.2 :(
Also, I think the patch should add --no-helper option to generators, which would skip generating helper/helper test. I find myself deleting helper file for most of the controllers I generate. It'd also help to discuss this change on the mailing list.
-
josh
- Milestone set to 2.x
-
Repository
- State changed from open to resolved
(from [3c9beb3dab73013af83b90983f283b76625052b8]) Add helper test generators [#1199 Helper test generator state:resolved]
Signed-off-by: Joshua Peek josh@joshpeek.com http://github.com/rails/rails/co...
