liqd / thentos

A tool for privacy-preserving identity management (PPIM)
Other
56 stars 9 forks source link

hspec open questions #140

Open mf59816 opened 9 years ago

mf59816 commented 9 years ago

In FrontendSpec, we say, after several other tests and after the before and after wrapper:

  -- (this is a separate top-level test case because it changes the DB
  -- state and gets the other tests confused.)
  describe "update user" . before setupTestServerFull . after teardownTestServerFull $ do
    spec_updateSelf

I thought though that each it should run in a state pristinely constructed by before, and torn down right after. See tests described as meta in ThentosSpec. What's with that?

fisx commented 9 years ago

The text above is confusing, let me clarify:

  1. is there any way we can run several its in the same before-after bracket?
  2. how can we make tests faster?
  3. (see above) remove misleading comment and consider restructuring test cases.
robx commented 9 years ago

There's beforeAll, afterAll that would do this (though by now FrontendSpec uses around, which doesn't have an aroundAll variant).