22{-# LANGUAGE TemplateHaskell #-}
33module GitHub.PublicSSHKeysSpec where
44
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 )
99
1010import Data.Either.Compat (isRight )
1111import Data.String (fromString )
1212import System.Environment (lookupEnv )
13- import Test.Hspec (Spec , describe , it , pendingWith , shouldBe ,
14- shouldSatisfy )
13+ import Test.Hspec (Spec , describe , it , pendingWith , shouldSatisfy )
1514
16- import qualified Data.HashMap.Strict as HM
1715import qualified Data.Vector as V
1816
1917fromRightS :: Show a => Either a b -> b
@@ -30,8 +28,8 @@ withAuth action = do
3028spec :: Spec
3129spec = do
3230 describe " publicSSHKeysFor'" $ do
33- it " works" $ do
34- keys <- publicSSHKeysFor' " phadej"
31+ it " works" $ withAuth $ \ auth -> do
32+ keys <- executeRequest auth $ publicSSHKeysForR " phadej" FetchAll
3533 V. length (fromRightS keys) `shouldSatisfy` (> 1 )
3634
3735 describe " publicSSHKeys' and publicSSHKey'" $ do
0 commit comments