@@ -3,6 +3,7 @@ package githandler
33import (
44 . "github.com/onsi/ginkgo"
55 . "github.com/onsi/gomega"
6+ "strings"
67)
78
89var _ = Describe ("Remote" , func () {
@@ -57,6 +58,40 @@ var _ = Describe("Remote", func() {
5758
5859 })
5960
61+ Context ("protocol tests" , func () {
62+
63+ type Case struct {
64+ Expected string
65+ Result string
66+ }
67+
68+ It ("Testing with expected result set git-phlow" , func () {
69+ c := Case {
"[email protected] :Praqma/git-phlow.git" ,
"Praqma:git-phlow" }
70+ Ω (OrgAndRepo (c .Expected ).Organisation ).Should (Equal (strings .Split (c .Result , ":" )[0 ]))
71+ Ω (OrgAndRepo (c .Expected ).Repository ).Should (Equal (strings .Split (c .Result , ":" )[1 ]))
72+
73+ })
74+ It ("Testing with expected result set grit" , func () {
75+ c := Case {"https://github.com/cho45/grit.git" , "cho45:grit" }
76+ Ω (OrgAndRepo (c .Expected ).Organisation ).Should (Equal (strings .Split (c .Result , ":" )[0 ]))
77+ Ω (OrgAndRepo (c .Expected ).Repository ).Should (Equal (strings .Split (c .Result , ":" )[1 ]))
78+
79+ })
80+ It ("Testing with expected result set hops" , func () {
81+ c := Case {"git://github.com/koke/hops.git" , "koke:hops" }
82+ Ω (OrgAndRepo (c .Expected ).Organisation ).Should (Equal (strings .Split (c .Result , ":" )[0 ]))
83+ Ω (OrgAndRepo (c .Expected ).Repository ).Should (Equal (strings .Split (c .Result , ":" )[1 ]))
84+
85+ })
86+ It ("Testing with expected result set helmsman" , func () {
87+ c := Case {"ssh://git@bitbucket:7560/praqma/helmsman.git" , "praqma:helmsman" }
88+ Ω (OrgAndRepo (c .Expected ).Organisation ).Should (Equal (strings .Split (c .Result , ":" )[0 ]))
89+ Ω (OrgAndRepo (c .Expected ).Repository ).Should (Equal (strings .Split (c .Result , ":" )[1 ]))
90+
91+ })
92+
93+ })
94+
6095 })
6196
6297})
0 commit comments