@@ -15,14 +15,30 @@ spec = do
1515 Spec .it " parses a remote with a git protocol" do
1616 parseRemote
" origin\t [email protected] :foo/bar.git (fetch)" 1717 `shouldEqual` Just { name:
" origin" , url:
" [email protected] :foo/bar.git" , owner:
" foo" , repo:
" bar" }
18+ parseRemote
" origin [email protected] :foo/bar.git (fetch)" 19+ `shouldEqual` Just { name:
" origin" , url:
" [email protected] :foo/bar.git" , owner:
" foo" , repo:
" bar" }
1820
1921 Spec .it " parses a remote with an https protocol" do
2022 parseRemote " origin\t https://github.com/foo/bar.git (push)"
2123 `shouldEqual` Just { name: " origin" , url: " https://github.com/foo/bar.git" , owner: " foo" , repo: " bar" }
24+ parseRemote " origin https://github.com/foo/bar.git (push)"
25+ `shouldEqual` Just { name: " origin" , url: " https://github.com/foo/bar.git" , owner: " foo" , repo: " bar" }
26+
27+ Spec .it " parses a remote with an ssh protocol" do
28+ parseRemote
" origin\t ssh://[email protected] /foo/bar.git (push)" 29+ `shouldEqual` Just { name:
" origin" , url:
" ssh://[email protected] /foo/bar.git" , owner:
" foo" , repo:
" bar" }
30+ parseRemote
" origin ssh://[email protected] /foo/bar.git (push)" 31+ `shouldEqual` Just { name:
" origin" , url:
" ssh://[email protected] /foo/bar.git" , owner:
" foo" , repo:
" bar" }
2232
2333 Spec .it " rejects malformed remotes" do
2434 parseRemote
" origin\t [email protected] :foo/bar.git" `shouldEqual` Nothing 35+ parseRemote
" origin [email protected] :foo/bar.git" `shouldEqual` Nothing 36+
2537 parseRemote
" origin\t [email protected] :foo/bar (push)" `shouldEqual` Nothing 26- parseRemote
" origin [email protected] :foo/bar.git (fetch)" `shouldEqual` Nothing 38+ parseRemote
" origin [email protected] :foo/bar (push)" `shouldEqual` Nothing 39+
2740 parseRemote
" origin\t [email protected] :foo.git (push)" `shouldEqual` Nothing 41+ parseRemote
" origin [email protected] :foo.git (push)" `shouldEqual` Nothing 42+
2843 parseRemote " origin\t https://foo.com/bar.git (push)" `shouldEqual` Nothing
44+ parseRemote " origin https://foo.com/bar.git (push)" `shouldEqual` Nothing
0 commit comments