Skip to content

Commit 104a8ad

Browse files
authored
Merge pull request #1694 from intolerable/intolerable/withTestApplication-aroundAll
use `aroundAll` instead of `around` with `testWithApplication`
2 parents 16cfd03 + 872acad commit 104a8ad

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

servant-auth/servant-auth-client/test/Servant/Auth/ClientSpec.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ spec = describe "The JWT combinator" $ do
5353
-- * HasClient {{{
5454

5555
hasClientSpec :: Spec
56-
hasClientSpec = describe "HasClient" $ around (testWithApplication $ return app) $ do
56+
hasClientSpec = describe "HasClient" $ aroundAll (testWithApplication $ return app) $ do
5757

5858
let mkTok :: User -> Maybe UTCTime -> IO Token
5959
mkTok user mexp = do

servant-auth/servant-auth-server/test/Servant/Auth/ServerSpec.hs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ spec = do
8080
authSpec :: Spec
8181
authSpec
8282
= describe "The Auth combinator"
83-
$ around (testWithApplication . return $ app jwtAndCookieApi) $ do
83+
$ aroundAll (testWithApplication . return $ app jwtAndCookieApi) $ do
8484

8585
it "returns a 401 if all authentications are Indefinite" $ \port -> do
8686
get (url port) `shouldHTTPErrorWith` status401
@@ -172,7 +172,7 @@ cookieAuthSpec :: Spec
172172
cookieAuthSpec
173173
= describe "The Auth combinator" $ do
174174
describe "With XSRF check" $
175-
around (testWithApplication . return $ app cookieOnlyApi) $ do
175+
aroundAll (testWithApplication . return $ app cookieOnlyApi) $ do
176176

177177
it "fails if XSRF header and cookie don't match" $ \port -> property
178178
$ \(user :: User) -> do
@@ -243,7 +243,7 @@ cookieAuthSpec
243243
describe "With no XSRF check for GET requests" $ let
244244
noXsrfGet xsrfCfg = xsrfCfg { xsrfExcludeGet = True }
245245
cookieCfgNoXsrfGet = cookieCfg { cookieXsrfSetting = fmap noXsrfGet $ cookieXsrfSetting cookieCfg }
246-
in around (testWithApplication . return $ appWithCookie cookieOnlyApi cookieCfgNoXsrfGet) $ do
246+
in aroundAll (testWithApplication . return $ appWithCookie cookieOnlyApi cookieCfgNoXsrfGet) $ do
247247

248248
it "succeeds with no XSRF header or cookie for GET" $ \port -> property
249249
$ \(user :: User) -> do
@@ -260,7 +260,7 @@ cookieAuthSpec
260260

261261
describe "With no XSRF check at all" $ let
262262
cookieCfgNoXsrf = cookieCfg { cookieXsrfSetting = Nothing }
263-
in around (testWithApplication . return $ appWithCookie cookieOnlyApi cookieCfgNoXsrf) $ do
263+
in aroundAll (testWithApplication . return $ appWithCookie cookieOnlyApi cookieCfgNoXsrf) $ do
264264

265265
it "succeeds with no XSRF header or cookie for GET" $ \port -> property
266266
$ \(user :: User) -> do
@@ -313,7 +313,7 @@ cookieAuthSpec
313313
jwtAuthSpec :: Spec
314314
jwtAuthSpec
315315
= describe "The JWT combinator"
316-
$ around (testWithApplication . return $ app jwtOnlyApi) $ do
316+
$ aroundAll (testWithApplication . return $ app jwtOnlyApi) $ do
317317

318318
it "fails if 'aud' does not match predicate" $ \port -> property $
319319
\(user :: User) -> do
@@ -378,7 +378,7 @@ jwtAuthSpec
378378

379379
basicAuthSpec :: Spec
380380
basicAuthSpec = describe "The BasicAuth combinator"
381-
$ around (testWithApplication . return $ app basicAuthApi) $ do
381+
$ aroundAll (testWithApplication . return $ app basicAuthApi) $ do
382382

383383
it "succeeds with the correct password and username" $ \port -> do
384384
resp <- getWith (defaults & auth ?~ basicAuth "ali" "Open sesame") (url port)

0 commit comments

Comments
 (0)