One of RSpec's many neat features is the ability to insert placeholder specs. These allow you to list a whole bunch of expected behaviour up front, without having to implement either the specs or the code, and without creating a huge swath of failing specs. All you need to do is omit the body of the specify or it block. Here's a trivial example:

RUBY:
  1. describe "The string 'foo'" do
  2.   before do
  3.     @foo = 'foo'
  4.   end
  5.  
  6.   it "should be three characters long" do
  7.     @foo.size.should == 3
  8.   end
  9.  
  10.   it "should be capitalised to 'Foo'"
  11. end

$ spec -f s foo_spec.rb                     

The string 'foo'
- should be three characters long
- should be capitalised to 'Foo' (NOT IMPLEMENTED)

Finished in 0.011201 seconds

2 examples, 0 failures, 1 not implemented

Technorati Tags: ,