Michael Erasmus
2011-Nov-30 10:56 UTC
Anyone have experience writing custom Rails generators? Do you test them?
I would like to experiment with writing a my own generator that I might want to eventually bundle into it''s own gem. What I would like to know if it''s feasible or considered best practice to write specs/ tests for your generator, and if so, any tips or examples you can point me to? -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Frederick Cheung
2011-Nov-30 14:22 UTC
Re: Anyone have experience writing custom Rails generators? Do you test them?
On Nov 30, 10:56 am, Michael Erasmus <michaeleras...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> I would like to experiment with writing a my own generator that I > might want to eventually bundle into it''s own gem. What I would like > to know if it''s feasible or considered best practice to write specs/ > tests for your generator, and if so, any tips or examples you can > point me to?You certainly can test them, for example here are the specs for the rspec generators: https://github.com/rspec/rspec-rails/tree/master/spec/generators Fred -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Dave Aronson
2011-Nov-30 19:12 UTC
Re: Anyone have experience writing custom Rails generators? Do you test them?
On Wed, Nov 30, 2011 at 05:56, Michael Erasmus <michaelerasmus-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> know if it''s feasible or considered best practice to write specs/ > tests for your generator,Of course! It''s considered best practice to write spec/tests for *everything*! :-) -Dave -- LOOKING FOR WORK! What: Ruby (on/off Rails), Python, other modern languages. Where: Northern Virginia, Washington DC (near Orange Line), and remote work. See: davearonson.com (main) * codosaur.us (code) * dare2xl.com (excellence). Specialization is for insects. (Heinlein) - Have Pun, Will Babble! (Aronson) -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Michael Erasmus
2011-Dec-01 14:35 UTC
Re: Anyone have experience writing custom Rails generators? Do you test them?
Cool, thanks a lot for the examples, I''m amazed by how clean and readable these specs are. On Nov 30, 4:22 pm, Frederick Cheung <frederick.che...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> On Nov 30, 10:56 am, Michael Erasmus <michaeleras...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > I would like to experiment with writing a my own generator that I > > might want to eventually bundle into it''s own gem. What I would like > > to know if it''s feasible or considered best practice to write specs/ > > tests for your generator, and if so, any tips or examples you can > > point me to? > > You certainly can test them, for example here are the specs for the > rspec generators:https://github.com/rspec/rspec-rails/tree/master/spec/generators > > Fred-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.