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@googlegroups.com.
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.

Search Discussions

  • Frederick Cheung at Nov 30, 2011 at 2:22 pm

    On Nov 30, 10:56 am, Michael Erasmus 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@googlegroups.com.
    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.
  • Michael Erasmus at Dec 1, 2011 at 2:36 pm
    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 wrote:
    On Nov 30, 10:56 am, Michael Erasmus 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@googlegroups.com.
    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 at Nov 30, 2011 at 7:13 pm

    On Wed, Nov 30, 2011 at 05:56, Michael Erasmus 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@googlegroups.com.
    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.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouprubyonrails-talk @
categoriesrubyonrails
postedNov 30, '11 at 1:56p
activeDec 1, '11 at 2:36p
posts4
users3
websiterubyonrails.org
irc#RubyOnRails

People

Translate

site design / logo © 2022 Grokbase