dchelimsky / rspec

Home | Edit | New

Pending Examples

You can write “unimplemented” or “do later examples”.

ex:
1 example, 0 failures, 1 pending

Here’s how to write them:

it "should do something" # no block
or
it "should do something" do
  pending "an announcement"
  # any code after the pending statement will not be run
end

or

it "should do something" do
  pending "an announcement" do
    # any code in this block *will* be run
    # - if it fails or raises, it will be reported as pending
    # - if it runs without a problem, it will be reported as a failure
    #    with a message indicating that you have a pending example
    #    that no longer needs to be pending
  end
end
Last edited by rspec, Thu Dec 31 10:25:09 -0800 2009
Home | Edit | New
Versions: