diff options
author | Máximo Cuadros <mcuadros@gmail.com> | 2017-01-26 14:31:46 +0100 |
---|---|---|
committer | Máximo Cuadros <mcuadros@gmail.com> | 2017-01-26 14:31:46 +0100 |
commit | b0a32a786e740d314bfc3d3ae76a698a81c39eb9 (patch) | |
tree | ae596ebb111e070b8e09ee31d3359abf8306ab70 /config/modules_test.go | |
parent | ec28bd3808d42f523eeb05e23909dbfc54eb9bcd (diff) | |
download | go-git-b0a32a786e740d314bfc3d3ae76a698a81c39eb9.tar.gz |
config: git modules config
Diffstat (limited to 'config/modules_test.go')
-rw-r--r-- | config/modules_test.go | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/config/modules_test.go b/config/modules_test.go new file mode 100644 index 0000000..50b5691 --- /dev/null +++ b/config/modules_test.go @@ -0,0 +1,23 @@ +package config + +import . "gopkg.in/check.v1" + +type ModuleSuite struct{} + +var _ = Suite(&ModuleSuite{}) + +func (s *ModuleSuite) TestModuleValidateMissingURL(c *C) { + m := &Module{Path: "foo"} + c.Assert(m.Validate(), Equals, ErrModuleEmptyURL) +} + +func (s *ModuleSuite) TestModuleValidateMissingName(c *C) { + m := &Module{URL: "bar"} + c.Assert(m.Validate(), Equals, ErrModuleEmptyPath) +} + +func (s *ModuleSuite) TestModuleValidateDefault(c *C) { + m := &Module{Path: "foo", URL: "http://foo/bar"} + c.Assert(m.Validate(), IsNil) + c.Assert(m.Branch, Equals, DefaultModuleBranch) +} |