Hi guys, Someone know some good introduction to rspec, I`m wanting to use Rspec with my Rails projects, but I don''t found a good introduction. Att, Pablo Lacerda de Miranda pablolmiranda at gmail.com -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/rspec-users/attachments/20090331/41aeb0e0/attachment.html>
Pablo L. de Miranda wrote:> Hi guys, > Someone know some good introduction to rspec, I`m wanting to use Rspec > with > my Rails projects, but I don''t found a good introduction. >>From my own experience:Write specs for your models and their class / instance methods. If you find yourself struggling to do that, it''s probably that too much logic is floating in your controllers, so move it to your model as much as you can. It took me roughly 5 tries to get a hang of RSpec. By tries I mean: I start writing specs, then get pissed off and stop for a few weeks/months, then get back to it again. Don''t bother specing your controllers and views. Just stick to the models or you''ll get pissed off. To spec controllers and views use Cucumber and webrat, but don''t dive into it right now. Oh and by the way, don''t use fixtures, instead write your own Factory. Be very patient, don''t try to do too much at a time, and have fun :-) -- Posted via http://www.ruby-forum.com/.
Hi Fernando, Are know, or have, some material ( tutorial, article, etc.. ) to recommend me? Att, Pablo Lacerda de Miranda Graduando Sistemas de Informa??o Universidade Estadual de Montes Claros pablolmiranda at gmail.com -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/rspec-users/attachments/20090331/2d0f26fb/attachment.html>
There are some great peepcode screencasts, if you like that kind of thing: http://peepcode.com/products/rspec-basics http://peepcode.com/products/rspec-mocks-and-models http://peepcode.com/products/rspec-controllers-and-tools Also the book is coming out it''s in beta now, http://www.pragprog.com/titles/achbd/the-rspec-book hth. 2009/3/31 Pablo L. de Miranda <pablolmiranda at gmail.com>> Hi Fernando, > Are know, or have, some material ( tutorial, article, etc.. ) to recommend > me? > > Att, > > Pablo Lacerda de Miranda > Graduando Sistemas de Informa??o > Universidade Estadual de Montes Claros > pablolmiranda at gmail.com > > > _______________________________________________ > rspec-users mailing list > rspec-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/rspec-users >-- http://www.fabled.net/blog/ -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/rspec-users/attachments/20090331/4ead5f7c/attachment.html>
Hi Sarah, I will take a look in the peepcode videos. Thank you, Pablo Lacerda de Miranda pablolmiranda at gmail.com -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/rspec-users/attachments/20090331/5462f406/attachment.html>
> http://peepcode.com/products/rspec-basics > http://peepcode.com/products/rspec-mocks-and-models > http://peepcode.com/products/rspec-controllers-and-tools >I didn''t like at all the peepcode episodes on RSpec. You''ll have to rewrite his valid_attributes trick from scratch if your models use attr_accessible, and some other stuff. The part about mocking is hard to grasp (although mocking is just such an easy concept). He uses fixtures, and tests for too many things in the views. I don''t spec at all the way he shows, I might be doing things wrong, but I am very happy with my workflow. -- Posted via http://www.ruby-forum.com/.
@Fernando - So what material you recommend to start a study in rSpec? Att, Pablo Lacerda de Miranda pablolmiranda at gmail.com -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/rspec-users/attachments/20090401/f54bc6ee/attachment.html>
Hi All, I think New user for rspec once need to see the peepcode videos. It is very helpful for the starter to understand how the rspec is working. Other wise the http://rspec.info documentation is providing the good information for any rails developer to use and test it in the application. Thanks, Dipen Bhanushali Complitech Solutions Private Limited (http://complitech.net) 2009/4/1 Pablo L. de Miranda <pablolmiranda at gmail.com>> @Fernando - So what material you recommend to start a study in rSpec? > > Att, > > Pablo Lacerda de Miranda > pablolmiranda at gmail.com > > > _______________________________________________ > rspec-users mailing list > rspec-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/rspec-users >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/rspec-users/attachments/20090401/115b3868/attachment-0001.html>
2009/4/1 Pablo L. de Miranda <pablolmiranda at gmail.com>:> @Fernando - So what material you recommend to start a study in rSpec?1.) The Web site documentation at http://rspec.info 2.) Use it and build experience. 3.) Get the beta of the RSpec book. 4.) Use it and build experience. 5.) Google is your friend. 6.) Use it and build experience. Finally, if in doubt... Try using it and building some experience. -- Have Fun, Steve Eley (sfeley at gmail.com) ESCAPE POD - The Science Fiction Podcast Magazine http://www.escapepod.org
On Tue, Mar 31, 2009 at 11:50 PM, Fernando Perez <lists at ruby-forum.com> wrote:> > I don''t spec at all the way he shows, I might be doing things wrong, but > I am very happy with my workflow.http://www.kipling.org.uk/poems_neolithic.htm (The poem''s by Rudyard Kipling, if the URL doesn''t make it clear.) -- Have Fun, Steve Eley (sfeley at gmail.com) ESCAPE POD - The Science Fiction Podcast Magazine http://www.escapepod.org
I''ve looked at the web site and I guess I''m looking for more examples. I''d like to see some simple basic ruby code and then some rSpec code testing it. No Rails, no nothing else. I haven''t tried the book yet, but there does not seem to be a lot of code out there at this basic a level. Any ideas? Scott On Wed, Apr 1, 2009 at 6:57 AM, Stephen Eley <sfeley at gmail.com> wrote:> 2009/4/1 Pablo L. de Miranda <pablolmiranda at gmail.com>: > > @Fernando - So what material you recommend to start a study in rSpec? > > 1.) The Web site documentation at http://rspec.info > > 2.) Use it and build experience. > > 3.) Get the beta of the RSpec book. > > 4.) Use it and build experience. > > 5.) Google is your friend. > > 6.) Use it and build experience. > > Finally, if in doubt... Try using it and building some experience. > > > -- > Have Fun, > Steve Eley (sfeley at gmail.com) > ESCAPE POD - The Science Fiction Podcast Magazine > http://www.escapepod.org > _______________________________________________ > rspec-users mailing list > rspec-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/rspec-users >-- Scott http://steamcode.blogspot.com/ -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/rspec-users/attachments/20090401/8bced54b/attachment.html>
2009/4/1 Scott LaBounty <slabounty at gmail.com>:> I''ve looked at the web site and I guess I''m looking for more examples. I''d > like to see some simple basic ruby code and then some rSpec code testing it. > No Rails, no nothing else. I haven''t tried the book yet, but there does not > seem to be a lot of code out there at this basic a level. > > Any ideas?Try this: http://blog.davidchelimsky.net/2007/5/14/an-introduction-to-rspec-part-i Cheers, David> > Scott > > On Wed, Apr 1, 2009 at 6:57 AM, Stephen Eley <sfeley at gmail.com> wrote: >> >> 2009/4/1 Pablo L. de Miranda <pablolmiranda at gmail.com>: >> > @Fernando - So what material you recommend to start a study in rSpec? >> >> 1.) The Web site documentation at http://rspec.info >> >> 2.) Use it and build experience. >> >> 3.) Get the beta of the RSpec book. >> >> 4.) Use it and build experience. >> >> 5.) Google is your friend. >> >> 6.) Use it and build experience. >> >> Finally, if in doubt... ?Try using it and building some experience. >> >> >> -- >> Have Fun, >> ? Steve Eley (sfeley at gmail.com) >> ? ESCAPE POD - The Science Fiction Podcast Magazine >> ? http://www.escapepod.org >> _______________________________________________ >> rspec-users mailing list >> rspec-users at rubyforge.org >> http://rubyforge.org/mailman/listinfo/rspec-users > > > > -- > Scott > http://steamcode.blogspot.com/ > > _______________________________________________ > rspec-users mailing list > rspec-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/rspec-users >
David, That''s more what I was looking for. Thanks, Scott On Wed, Apr 1, 2009 at 8:44 AM, David Chelimsky <dchelimsky at gmail.com>wrote:> 2009/4/1 Scott LaBounty <slabounty at gmail.com>: > > I''ve looked at the web site and I guess I''m looking for more examples. > I''d > > like to see some simple basic ruby code and then some rSpec code testing > it. > > No Rails, no nothing else. I haven''t tried the book yet, but there does > not > > seem to be a lot of code out there at this basic a level. > > > > Any ideas? > > Try this: > > http://blog.davidchelimsky.net/2007/5/14/an-introduction-to-rspec-part-i > > Cheers, > David > > > > > > > Scott > > > > On Wed, Apr 1, 2009 at 6:57 AM, Stephen Eley <sfeley at gmail.com> wrote: > >> > >> 2009/4/1 Pablo L. de Miranda <pablolmiranda at gmail.com>: > >> > @Fernando - So what material you recommend to start a study in rSpec? > >> > >> 1.) The Web site documentation at http://rspec.info > >> > >> 2.) Use it and build experience. > >> > >> 3.) Get the beta of the RSpec book. > >> > >> 4.) Use it and build experience. > >> > >> 5.) Google is your friend. > >> > >> 6.) Use it and build experience. > >> > >> Finally, if in doubt... Try using it and building some experience. > >> > >> > >> -- > >> Have Fun, > >> Steve Eley (sfeley at gmail.com) > >> ESCAPE POD - The Science Fiction Podcast Magazine > >> http://www.escapepod.org > >> _______________________________________________ > >> rspec-users mailing list > >> rspec-users at rubyforge.org > >> http://rubyforge.org/mailman/listinfo/rspec-users > > > > > > > > -- > > Scott > > http://steamcode.blogspot.com/ > > > > _______________________________________________ > > rspec-users mailing list > > rspec-users at rubyforge.org > > http://rubyforge.org/mailman/listinfo/rspec-users > > > _______________________________________________ > rspec-users mailing list > rspec-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/rspec-users >-- Scott http://steamcode.blogspot.com/ -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/rspec-users/attachments/20090401/587cb956/attachment-0001.html>
Pablo L. de Miranda wrote:> @Fernando - So what material you recommend to start a study in rSpec? >This might be heresy, but I suggest that you start with Cucumber and simply use RSpec matcher syntax in your step definitions. Once you have the hang of how to express expectations in the step definitions, then move on to using RSpec on its own; providing that you still want to. I really did not get the hang of any of this, TDD, BDD, Rails or Ruby until I latched on to Cucumber and started -- very, very poorly mind you -- to discover how to express behaviour and, more importantly, what behaviour to express. It was, for me, a tumultuous journey and one that I am still traveling. I am now at the point where, simply by expressing one little bit of desired bwhaviour in a cucumber scenario, I uncovered a requirement to leave Rails for a bit and implement a set of SQL triggers. This would have been discovered at some point anyway, but I rather suspect that without BDD the implementation would have been written first in Ruby for ActiveRecord only to be discarded sometime later when the need for a trigger became manifest. Peepcode is good, I have watched and learned lots there. Just recall that the episodes go far back in time insofar as Rails and RSpec are concerned. These two products have undergone extensive change since many of the episodes were recorded. -- Posted via http://www.ruby-forum.com/.
On Wed, Apr 1, 2009 at 11:50 AM, James Byrne <lists at ruby-forum.com> wrote:> Pablo L. de Miranda wrote: >> @Fernando - So what material you recommend to start a study in rSpec? >> > > This might be heresy, but I suggest that you start with Cucumber and > simply use RSpec matcher syntax in your step definitions. ? Once you > have the hang of how to express expectations in the step definitions, > then move on to using RSpec on its own; providing that you still want > to. > > I really did not get the hang of any of this, TDD, BDD, Rails or Ruby > until I latched on to Cucumber and started -- very, very poorly mind you > -- to discover how to express behaviour and, more importantly, what > behaviour to express. ?It was, for me, a tumultuous journey and one that > I am still traveling. > > I am now at the point where, simply by expressing one little bit of > desired bwhaviour in a cucumber scenario, I uncovered a requirement to > leave Rails for a bit and implement a set of SQL triggers. ?This would > have been discovered at some point anyway, but I rather suspect that > without BDD the implementation would have been written first in Ruby for > ActiveRecord only to be discarded sometime later when the need for a > trigger became manifest. > > Peepcode is good, I have watched and learned lots there. ?Just recall > that the episodes go far back in time insofar as Rails and RSpec are > concerned. ?These two products have undergone extensive change since > many of the episodes were recorded.Thanks for sharing James. I know when you first joined the list there were a few frustrating moments, and it''s really good to hear about where you''ve come and how you''ve gotten there. This is helpful to both newbs and seasoned BDDers alike, -- Zach Dennis http://www.continuousthinking.com http://www.mutuallyhuman.com
Zach Dennis wrote:> > > Thanks for sharing James. I know when you first joined the list there > were a few frustrating moments, and it''s really good to hear about > where you''ve come and how you''ve gotten there. This is helpful to both > newbs and seasoned BDDers alike, >I am very, very grateful for all of the advice and assistance that has been given to me here. I am also very grateful for all the tools provided to me by the community, of which Cucumber and RSpec are probably most important to me after Ruby and Rails. I am still making mistakes of course, but now only one of each kind. I hope. -- Posted via http://www.ruby-forum.com/.