2
2
{-# LANGUAGE TemplateHaskell #-}
3
3
module GitHub.PublicSSHKeysSpec where
4
4
5
- import GitHub ( Auth ( .. ), PublicSSHKeyBasic ( .. ), PublicSSHKey ( .. ),
6
- executeRequest , repositoryR )
7
- import GitHub.Endpoints.Users.PublicSSHKeys ( publicSSHKeysFor' , publicSSHKeys' ,
8
- publicSSHKey' )
5
+ import GitHub
6
+ ( Auth ( .. ), FetchCount ( .. ), PublicSSHKey ( .. ), executeRequest )
7
+ import GitHub.Endpoints.Users.PublicSSHKeys
8
+ ( publicSSHKey' , publicSSHKeys' , publicSSHKeysForR )
9
9
10
10
import Data.Either.Compat (isRight )
11
11
import Data.String (fromString )
12
12
import System.Environment (lookupEnv )
13
- import Test.Hspec (Spec , describe , it , pendingWith , shouldBe ,
14
- shouldSatisfy )
13
+ import Test.Hspec (Spec , describe , it , pendingWith , shouldSatisfy )
15
14
16
- import qualified Data.HashMap.Strict as HM
17
15
import qualified Data.Vector as V
18
16
19
17
fromRightS :: Show a => Either a b -> b
@@ -30,8 +28,8 @@ withAuth action = do
30
28
spec :: Spec
31
29
spec = do
32
30
describe " publicSSHKeysFor'" $ do
33
- it " works" $ do
34
- keys <- publicSSHKeysFor' " phadej"
31
+ it " works" $ withAuth $ \ auth -> do
32
+ keys <- executeRequest auth $ publicSSHKeysForR " phadej" FetchAll
35
33
V. length (fromRightS keys) `shouldSatisfy` (> 1 )
36
34
37
35
describe " publicSSHKeys' and publicSSHKey'" $ do
0 commit comments