RSpec Logo
Behaviour Driven
Development for Ruby.
Making TDD Productive and Fun.

Let's get started!

To kick things off, install RSpec and run rspec --init to set up your project to use RSpec.

Start with a very simple example that expresses some basic desired behaviour.

Run the example and watch it fail.

Implement that basic behaviour...

Run the example and bask in the joy that is green.

Take very small steps

Don’t rush ahead with more code. Instead, add another example and let it guide you to what you have to do next. And don’t forget to take time to refactor your code before it gets messy. You should keep your code clean at every step of the way.

View Documentation
Behaviour Driven Development in Ruby with RSpec

The RSpec Book

The RSpec Book will introduce you to RSpec, Cucumber, and a number of other tools that make up the Ruby BDD family. Replete with tutorials and practical examples, the RSpec Book will help you get your BDD on, taking you from executable requirements to working software that is clean, well tested, well documented, flexible and highly maintainable.

Check out the book

Testing Ruby Application with RSpec Screencast

The Screencast

The Testing Ruby Applications with RSpec screencast introduces the core RSpec libraries through the development of a small CLI card game. In addition to covering the technical aspects of using RSpec, it also covers best practices for using them so you get the most out of your test suite: different types of tests, what kinds of things to test, when different styles are appropriate.

Check out the screencast