Safety Month botysf16 Amazon Fashion Learn more Discover it $5 Albums The best from Bose just got wireless Fire TV Stick Sun Care Patriotic Picks STEM Amazon Cash Back Offer AnnedroidsS3 AnnedroidsS3 AnnedroidsS3  Amazon Echo  Echo Dot  Amazon Tap  Echo Dot  Amazon Tap  Amazon Echo Starting at $49.99 All-New Kindle Oasis Best Camping & Hiking Gear in Outdoors
Customer Review

8 of 9 people found the following review helpful
5.0 out of 5 stars Great up-to-date walkthrough of RSpec 2.0, Cucumber and how to use them with Rails, March 15, 2011
This review is from: The RSpec Book: Behaviour Driven Development with RSpec, Cucumber, and Friends (Facets of Ruby) (Paperback)
The RSpec Book is a 400 page book by David Chelimsky and a cadre of BDD (Behavior Driven Development) experts. Its aim is to teach you all about RSpec (RSpec 2.0 - specifically!) and BDD from the ground up and it promises to "help you write better code, write better tests, and delver better software to your users."

Robert C. Martin (a.k.a. Uncle Bob) kicks off the book with a foreword that warns us of what's to come. He says that the book is a trap and isn't really about RSpec. I won't spoil the whole surprise of his delivery but his general point is that the book is focused on teaching you software craftsmanship using BDD (and testing in general) as the framework for putting together well-crafted software. This point is significant because The RSpec Book focuses on the concepts of BDD just as much as it does on the technicalities of RSpec itself.

The book starts with an extensive Getting Started section headed by a quick chapter summarizing RSpec and Cucumber before moving on to a suite of walkthrough-style chapters dedicated to building a 'code breaker' game. Acceptance Test-Driven Planning is used which essentially means the acceptance tests are written first in the form of Cucumber features so for two chapters you don't get to see any RSpec at all. Once RSpec comes into the mix, though, things move quickly and mocks (doubles) and stubs are introduced quickly. The 'code breaker' game work then continues for a couple of chapters with a brief detour into refactoring.

The second section of the book - Behavior Driven Development - is made up of two code-free chapters that look at BDD from a higher level. A lot of this portion is quite opinionated but if you want to get an overall feel for the BDD process and how different concepts interlock with it, it's a great primer.

The third section of the book - RSpec - proved to be the real "meat" for me. There are several chapters digging solely into the ins and outs of RSpec 2.0 itself. You learn how to use RSpec from the basics up, working through matchers, best practices, mocks, macros, custom formatters, custom matchers, and how the RSpec toolkit can integrate with other tools (such as TextMate). You basically get a 102 page guide to RSpec 2.0 here and that might be worth the price of admission alone.

Sections dedicated to Cucumber and Rails follow on to close the book. I found the Rails section particularly useful having not previously gotten on to the RSpec 2 bandwagon with Rails 3. There are several chapters that each walk through a particular topic, like view specs, controller specs, and model specs. I didn't want to digest the entire set at once and the structure helped me just dig into the parts I was immediately interested in without following each chapter in order. The large number of short and sweet code examples also helps if you're just scanning through looking for some guidance.

In short, I recommend The RSpec Book. The other reviews here seem to be rather mixed so you might want to check them out to get the bigger picture, but I've found the book to be rather useful with its direct narrative style, logical structure, and vast number of short code examples from which to descry some handy techniques.
Help other customers find the most helpful reviews 
Was this review helpful to you? Yes No

Be the first person to comment on this review.

[Add comment]
Post a comment
To insert a product link use the format: [[ASIN:ASIN product-title]] (What's this?)
Amazon will display this name with all your submissions, including reviews and discussion posts. (Learn more)
Name:
Badge:
This badge will be assigned to you and will appear along with your name.
There was an error. Please try again.
Please see the full guidelines here.

Official Comment

As a representative of this product you can post one Official Comment on this review. It will appear immediately below the review wherever it is displayed.   Learn more
The following name and badge will be shown with this comment:
 (edit name)
After clicking the Post button you will be asked to create your public name, which will be shown with all your contributions.

Is this your product?

If you are the author, artist, manufacturer or an official representative of this product, you can post an Official Comment on this review. It will appear immediately below the review wherever it is displayed.  Learn more
Otherwise, you can still post a regular comment on this review.

Is this your product?

If you are the author, artist, manufacturer or an official representative of this product, you can post an Official Comment on this review. It will appear immediately below the review wherever it is displayed.   Learn more
 
System timed out

We were unable to verify whether you represent the product. Please try again later, or retry now. Otherwise you can post a regular comment.

Since you previously posted an Official Comment, this comment will appear in the comment section below. You also have the option to edit your Official Comment.   Learn more
The maximum number of Official Comments have been posted. This comment will appear in the comment section below.   Learn more
Prompts for sign-in
  [Cancel]