How To: Setup RSpec, Cucumber, Webrat, RCov and Autotest on Leopard

Prerequisites I’m assuming you’ve got the following installed: ruby ruby gems 1.3.1 Apple development tools git rails >= 2.3.2 You’ve added github to your gem sources (gem sources -a RSpec & RSpec-Rails First let’s grab the rspec1 and rspec-rails2 gems. sudo gem install rspec sudo gem install rspec-rails Cucumber Next we’ll install the cucumber3 gem

RSpec Shared Example Gotcha

Below we have an example model, spec and shared example group. Our Dog model has its own set of functionality, but as a mammal it should still have some aspects of being a mammal. We’ve got some specs in a shared example group that we use for testing all of our mammal models to make sure things don’t get too out of whack in the universe. Our Example Model class Dog attr_accessor :name, :mammal def initialize self.