implemented Helpers.makeHttps
This commit is contained in:
@@ -33,6 +33,7 @@ spec :: Spec
|
||||
spec = do
|
||||
textToUrlSpec
|
||||
urlToTextSpec
|
||||
makeHttpsSpec
|
||||
editHostSpec
|
||||
|
||||
textToUrlSpec :: Spec
|
||||
@@ -65,6 +66,23 @@ urlToTextSpec = describe "urlToText" $ mapM_
|
||||
, ( anchorUrl, anchorTxt )
|
||||
]
|
||||
|
||||
makeHttpsSpec :: Spec
|
||||
makeHttpsSpec = describe "makeHttps" $ mapM_
|
||||
( \(desc, input, expected) -> context desc $
|
||||
it ("should be " ++ show expected) $
|
||||
makeHttps input `shouldBe` expected
|
||||
)
|
||||
|
||||
-- description, input, expected
|
||||
[ ( "HTTP", simpleUrl, Just https )
|
||||
, ( "HTTPS", https, Just https )
|
||||
, ( "FTP", urlWith "ftp", Nothing )
|
||||
]
|
||||
|
||||
where
|
||||
https = urlWith "https"
|
||||
urlWith p = simpleUrl { protocol = p }
|
||||
|
||||
editHostSpec ::Spec
|
||||
editHostSpec = describe "editHost" $ mapM_
|
||||
( \(desc, f, url, expected) -> context desc $
|
||||
|
||||
Reference in New Issue
Block a user