I want to go in and improve the default scaffold (ex resource_scaffold) a bit and noticed the lack of tests for generators. So I thought I''d give people a heads up that I''m working on creating initially tests for the scaffold generator as well as test helpers to make it simpler to test generators in the future. I''ll probably go through and create tests for the built in generators as well eventually. I have a question about layout. I''m currently placing the scaffold tests in: railties/test/rails_scaffold_generator_test.rb Does that make sense naming wise? So afterwards there could be: railties/test/rails_model_generator_test.rb etc. I''ve also created the test helpers in railties/test/generator_test_helpers.rb Does that follow convension or should I rather put them somewhere else, to make it easier for say plugin developers to use them? Finally as part of my testing I build up a very basic rails directory structure under railties/test/fixtures/tmp and then delete it again in the teardown. I have seen similar things done in the tests from various plugins and it works, can anyone see any issues with that? Pelle --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com To unsubscribe from this group, send email to rubyonrails-core-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en -~----------~----~----~----~------~----~------~--~---
On 5/21/07, Pelle <pelleb@gmail.com> wrote:> I want to go in and improve the default scaffold (ex > resource_scaffold) a bit and noticed the lack of tests for generators. > > So I thought I''d give people a heads up that I''m working on creating > initially tests for the scaffold generator as well as test helpers to > make it simpler to test generators in the future. I''ll probably go > through and create tests for the built in generators as well > eventually.Sounds great, Pelle.> I have a question about layout. I''m currently placing the scaffold > tests in: > > railties/test/rails_scaffold_generator_test.rb > > Does that make sense naming wise? So afterwards there could be: > > railties/test/rails_model_generator_test.rb > etc. > > I''ve also created the test helpers in > > railties/test/generator_test_helpers.rb > > Does that follow convension or should I rather put them somewhere > else, to make it easier for say plugin developers to use them?how about a test subdirectory, like railties/test/generators/*> Finally as part of my testing I build up a very basic rails directory > structure under railties/test/fixtures/tmp and then delete it again in > the teardown. I have seen similar things done in the tests from > various plugins and it works, can anyone see any issues with that?Nope. All good. jeremy --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com To unsubscribe from this group, send email to rubyonrails-core-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en -~----------~----~----~----~------~----~------~--~---
Great On May 21, 12:04 pm, "Jeremy Kemper" <jer...@bitsweat.net> wrote:> how about a test subdirectory, like railties/test/generators/*Will do. I''ll submit a patch within a few days, I''m nearly done on the scaffold tests. I''m not sure to what level I should test it but I''ll at least get a fairly thorough starting point in place. Pelle --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com To unsubscribe from this group, send email to rubyonrails-core-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en -~----------~----~----~----~------~----~------~--~---
OK. I''ve uploaded my patch with the scaffold generator tests at: http://dev.rubyonrails.org/ticket/8443 It also includes a generator_test_helper module, which has lots of helpful assertions, which could be used for testing most kinds of generators. Regards Pelle On May 21, 12:04 pm, "Jeremy Kemper" <jer...@bitsweat.net> wrote:> On 5/21/07, Pelle <pel...@gmail.com> wrote: > > > I want to go in and improve the defaultscaffold(ex > > resource_scaffold) a bit and noticed the lack of tests for generators. > > > So I thought I''d give people a heads up that I''m working on creating > > initially tests for thescaffoldgeneratoras well as test helpers to > > make it simpler to test generators in the future. I''ll probably go > > through and create tests for the built in generators as well > > eventually. > > Sounds great, Pelle. > > > > > I have a question about layout. I''m currently placing thescaffold > > tests in: > > > railties/test/rails_scaffold_generator_test.rb > > > Does that make sense naming wise? So afterwards there could be: > > > railties/test/rails_model_generator_test.rb > > etc. > > > I''ve also created the test helpers in > > > railties/test/generator_test_helpers.rb > > > Does that follow convension or should I rather put them somewhere > > else, to make it easier for say plugin developers to use them? > > how about a test subdirectory, like railties/test/generators/* > > > Finally as part of my testing I build up a very basic rails directory > > structure under railties/test/fixtures/tmp and then delete it again in > > the teardown. I have seen similar things done in the tests from > > various plugins and it works, can anyone see any issues with that? > > Nope. All good. > > jeremy--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com To unsubscribe from this group, send email to rubyonrails-core-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en -~----------~----~----~----~------~----~------~--~---