views:

14

answers:

1

This should be simple but I can't find any examples. I have standard functional tests in my rails 3 application (descending from ActionController::TestCase) that look like:

test "see if 1+1=2" do
....
end

and at the top I have a setup method:

setup do
  ......
end

How do I exclude a method? I.e.

setup :except => "see if 1+1=2" do
...
end

(above doesn't work obv)

Thanks

A: 

Use shoulda and context blocks, that way you can put the tests using the setup in one context, and the tests not using them in another, or outside the other context block.

rspeicher