Alex Rivera | Logout

Multiple should statements in one rspec it clause - bad idea?

Asked 2012-12-28T11:29:47.777
16

Here's my rspec test:

it "can release an idea" do
  james.claim(si_title)
  james.release(si_title)
  james.ideas.size.should eq 0
  si_title.status.should eq "available"
end

Are the two should lines at the end a really bad idea? I read somewhere that you should only test for one thing per it block, but it seems silly to make a whole test just to make sure that the title status changes (the same function does both things in my code).

Edit
Report

1 Answer

3

I have the same problem... It ought to be one should per it (my boss says) by it makes testing time consuming and, as you said, silly. Tests require good sense and flexibility or they might end up enslaving you. Anyway, I agree with your test.

answered 2012-12-28T11:58:37.487

Your Answer