[rspec-users] How do you use pending in RSpec?

Bill Venners bill at artima.com
Thu Mar 12 17:50:05 EDT 2009

Hi All,

I've been working on BDD support in a test framework for Scala
imaginatively called ScalaTest, and I want to add support for the
notion of pending examples. I see three different "forms" of pending
in RSpec, and I'm curious to hear which ones RSpec users find most
useful. The three forms are:

# 1. With no block you get a PENDING (Not Yet Implemented) in the report
it "should say foo"

# 2. Passing a string, but no block, to pending. You get the PENDING
(get the vocal chords working) in the report.
it "should say foo" do
  pending("get the vocal chords working")
  subject.should say("foo")

# 3. Pass a string and a block to pending. If the pending code raises
an exception, then you get PENDING (get the vocal chords working)k
# but if not, I believe the whole tests fails to let you know you need
to drop the pending stuff now that it works (I may be wrong).
it "should say foo" do
  pending("get the vocal chords working") do
    subject.should say("foo")

Which of these forms do you find the most useful in practice, and are
there any that you think would be better left out?


Bill Venners
Artima, Inc.

More information about the rspec-users mailing list