diff options
Diffstat (limited to 'plumbing/transport/common_test.go')
-rw-r--r-- | plumbing/transport/common_test.go | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/plumbing/transport/common_test.go b/plumbing/transport/common_test.go new file mode 100644 index 0000000..9ca4459 --- /dev/null +++ b/plumbing/transport/common_test.go @@ -0,0 +1,31 @@ +package transport + +import ( + "testing" + + . "gopkg.in/check.v1" +) + +func Test(t *testing.T) { TestingT(t) } + +type SuiteCommon struct{} + +var _ = Suite(&SuiteCommon{}) + +func (s *SuiteCommon) TestNewEndpoint(c *C) { + e, err := NewEndpoint("ssh://git@github.com/user/repository.git") + c.Assert(err, IsNil) + c.Assert(e.String(), Equals, "ssh://git@github.com/user/repository.git") +} + +func (s *SuiteCommon) TestNewEndpointSCPLike(c *C) { + e, err := NewEndpoint("git@github.com:user/repository.git") + c.Assert(err, IsNil) + c.Assert(e.String(), Equals, "ssh://git@github.com/user/repository.git") +} + +func (s *SuiteCommon) TestNewEndpointWrongForgat(c *C) { + e, err := NewEndpoint("foo") + c.Assert(err, Not(IsNil)) + c.Assert(e.Host, Equals, "") +} |