views:

6337

answers:

4

I'm looking to get started building a project and want to use RSpec from day one. My Ruby background is limited, however, I do have a good understanding of MVC and the structure within Ruby.

In doing some research for books and tutorials, I've found no currently published books, and have found no tutorials that give a good "hello world" type write up. And the documentation on the RSpec site is sparse to say the least.

Do any of you have links you'd like to share of good tutorials of getting started with roR and RSpec?

+5  A: 

Peepcode has a fantastic Screencast series ($) on RSpec that should get you started:

Peepcode is a fantastic resource and the quality of the videos are top notch. I would also recommend their unlimited plan for $149 which gives you access to all of their content for a year (and any content released in the next year).

Good luck!

mwilliams
I should also add, Shoulda, http://www.thoughtbot.com/projects/shoulda, is a fantastic testing framework as well. I have seen many move from RSpec to Shoulda (but RSpec is a wonderful and very powerful tool). Just giving you some other options.
mwilliams
thx for this additional link. since i am building an app from scratch, i plan to stick with RSpec. If i were trying to migrate an existing app to a BDD style setup, i'd go with Shoulda since it claims to require no code changes to existing code.
levi rosol
and thanks for the peepcode link. in my search it never came up, but i have seen it before. It just didn't dawn on me to check it out.i really wish SO would force people to leave a comment if they downgrade a question or answer...
levi rosol
Agreed, that downgrade had me scratching my head.
mwilliams
Good call with peepcode- worth the $$ if you're getting started learning the RoR world.
mhamrah
+20  A: 

A good tutorial

http://blog.davidchelimsky.net/articles/2007/05/14/an-introduction-to-rspec-part-i

examples on the RSpec site http://rspec.info/examples.html

the rspec Docs which will be useful http://rspec.rubyforge.org/rspec/1.1.8/

developing a rails model with Rspec and BDD http://www.lukeredpath.co.uk/2006/8/29/developing-a-rails-model-using-bdd-and-rspec-part-1

danmayer
the link for the examples is broken...
nivcaner
+2  A: 

I'll second the ringing endorsement of the Peepcode screencasts. I would definitely start with those.

One resource that might not be obvious is Ian Dees' Scripted GUI Testing with Ruby. It's not specifically geared towards Rails, but it has some of the clearest and most detailed examples of RSpec that I've seen. In particular, the chapter on integrating RSpec and Selenium is excellent.

Abie
Nice one. I'll be looking into this. RSpec is missing good books so even though this isn't rails it may help fill the hole until the RSpec comes out (If it does!)
srboisvert
+3  A: 

The RSpec Book by David Chelimsky et al. is now in beta:

http://www.pragprog.com/titles/achbd/the-rspec-book

Antti Tarvainen
Yes, and you can buy a soft copy!
Rimian