[Note: parts of this message were removed to make it a legal post.]
I'd recommend "The RSpec book" from the Pragmatic Programmers which is
currently in the last stages of their beta program, which means that
you can buy the book as a PDF and optionally get the printed book when
available.
It's been in the last stages of beta for a really long time now
It's
release date has been pushed back at least three times this year already.
There was also supposed to be a book on RSpec by Apress but it seems nothing
ever happened with that (it is alleged to already be released
http://www.amazon.com/Foundations-R...1_fkmr1_2?ie=UTF8&qid=1275903384&sr=1-2-fkmr1)
And Addison-Wesley was supposed to release a book on it back in April,
but
that hasn't happened and the book's page is now gone from Amazon. Back in
Feb I was asking about these books (
http://www.ruby-forum.com/topic/204576) Noone really had much to say.
I enjoyed your blog about creating your own RSpec book from the beta PDF. (
http://talklikeaduck.denhaven2.com/...letely-different-diy-bookbinding-on-the-cheap)
And I have it since my boss pre-ordered. But I have a hard time motivating
myself to try and read something that I feel like is going to be deprecated
soon. I won't have the time or motivation to read it twice.
@Lakshmana: the first chapter of Ruby Best Practices is about testing
(Test::Unit) the book is not really aimed at people new to Ruby, but it has
a lot of code examples, and you can download the PDF for free from
http://rubybestpractices.com/ (if you're satisfied, you can support Open
Source and the author, by purchasing it
http://oreilly.com/catalog/9780596523008/index.html) Although, I just
glanced at the Pickaxe's chapter on unit testing, and I'm not sure whether
RBP has more to offer (still, free to check it out). Still, don't get hung
up on whether you understand every nut and bolt of everything. The Pickaxe's
chapter looks like it should be good enough to get started, and it is more
important that you incorrectly start, than that you correctly do not start.
Once you get started, you'll have a better understanding of the domain,
which will make it easier to learn from reading other resources later down
the line. In other words, you can begin testing with just a bare minimum of
tools, and you should.
RSpec's documentation is also pretty good
http://rspec.info/documentation/
And I feel like I ...oughta... mention shoulda, b/c there are a lot of
Rubyists who like it, but I honestly know next to nothing about it, so I'll
let someone else fill in those details. Here is their github, though (
http://github.com/thoughtbot/shoulda).
I also feel like I should mention that there are two Peepcodes about RSpec,
but a lot of the stuff in them is already deprecated and doesn't work, and
it's especially frustrating when learning the unfamiliar, if you don't
really know what something does, but it isn't working, and you aren't sure
why not, or how big of a deal it is. NOTE: I just went to check it out, and
they now have 4 peepcodes on BDD, including cucumber and mocking. The ones I
watched say they have been updated, but I'm not sure if that was before or
after I tried going through it. (
http://peepcode.com/)