[rspec-users] Use filters to wrap examples into a pending block?

Jeroen van Dijk jeroentjevandijk at gmail.com
Thu Dec 23 05:57:36 EST 2010


Hi all,

I was wonder whether something like the following is possible in RSpec?

RSpec.configure do |c|
  c.filter_examples : pending_for_some_reason => lambda {|example|
    pending "This example is failing due to upgrade of x" do
       example.call
    end
  }
end

it "should succeed, but probably doesn't yet", :pending_for_some_reason =>
true do
   raise "fail"
end

I'm currently working on a library that has many failing specs due to an
upgrade of a dependency. It would be nice if a could just flag examples that
are failing due to that change without having to copy paste the pending
block.

Cheers,
Jeroen
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://rubyforge.org/pipermail/rspec-users/attachments/20101223/9d208283/attachment.html>


More information about the rspec-users mailing list