Path: | README |
Last Update: | Sat Mar 15 10:40:52 -0600 2008 |
RSpec is a Behaviour Driven Development framework with tools to express User Stories with Executable Scenarios and Executable Examples at the code level.
RSpec ships with several modules:
Spec::Story provides a framework for expressing User Stories
Spec::Example provides a framework for expressing code Examples
Spec::Matchers provides Expression Matchers for use with Spec::Expectations and Spec::Mocks.
Spec::Expectations supports setting expectations on your objects so you can do things like:
result.should equal(expected_result)
Spec::Mocks supports creating Mock Objects, Stubs, and adding Mock/Stub behaviour to your existing objects.
The simplest approach is to install the gem:
gem install -r rspec #mac users must sudo
If you prefer to build the gem locally, check out source from svn://rubyforge.org/var/svn/rspec/trunk. Then do the following:
rake gem gem install pkg/rspec-0.x.x.gem (you may have to sudo)
In order to run RSpec‘s full suite of specs (rake pre_commit) you must install the following gems:
Once those are all installed, you should be able to run the suite with the following steps:
Note that RSpec itself - once built - doesn‘t have any dependencies outside the Ruby core and stdlib - with a few exceptions:
See rspec.rubyforge.org for further documentation.