日記はScrapboxに移動しました。

Use `pending` with Time Limit

@sora_h made a tool named pendax which is to urge people to fix pending examples. It’s totally right that we shouldn’t use pending in specs in the first place, but pendings are needed some time for some reason.

@tokuhirom suggested to use pending with obvious time limit for that case. pending takes if/unless options (document). We can use it to indicate that time limit:

require 'rspec'
describe 'pending' do
it 'should be in status, pending' do
pending 'pending'
expect(nil).to be_true
end
it 'should not be in status, pending' do
pending "I'll definitely fix this!!1", if: Time.now < Time.local(2012, 10, 31)
expect(nil).to be_true
end
end

Leave a Reply

Your email address will not be published. Required fields are marked *