aboutsummaryrefslogtreecommitdiffstats
path: root/config/config_test.go
diff options
context:
space:
mode:
authorMáximo Cuadros <mcuadros@gmail.com>2016-11-07 20:29:58 +0100
committerGitHub <noreply@github.com>2016-11-07 20:29:58 +0100
commit0ff9ef2b44c53e557c78bde0fd9c29847e5f0e23 (patch)
treeb9c7485fe99e6e89fa736ceb0223aeb2ecddb77c /config/config_test.go
parentf6ed7424cbf33c7013332d7e95b4262a4bc4a523 (diff)
downloadgo-git-0ff9ef2b44c53e557c78bde0fd9c29847e5f0e23.tar.gz
global storage interface refactor (#112)
* core: ObjectStorage, ReferenceStorage renamed to ObjectStorer and ReferenceStorer * rebase * general, changes request by @alcortes * general, changes request by @alcortes
Diffstat (limited to 'config/config_test.go')
-rw-r--r--config/config_test.go20
1 files changed, 20 insertions, 0 deletions
diff --git a/config/config_test.go b/config/config_test.go
index d97053b..f2539d0 100644
--- a/config/config_test.go
+++ b/config/config_test.go
@@ -6,6 +6,26 @@ type ConfigSuite struct{}
var _ = Suite(&ConfigSuite{})
+func (s *ConfigSuite) TestConfigValidateInvalidRemote(c *C) {
+ config := &Config{
+ Remotes: map[string]*RemoteConfig{
+ "foo": {Name: "foo"},
+ },
+ }
+
+ c.Assert(config.Validate(), Equals, ErrRemoteConfigEmptyURL)
+}
+
+func (s *ConfigSuite) TestConfigValidateInvalidKey(c *C) {
+ config := &Config{
+ Remotes: map[string]*RemoteConfig{
+ "bar": {Name: "foo"},
+ },
+ }
+
+ c.Assert(config.Validate(), Equals, ErrInvalid)
+}
+
func (s *ConfigSuite) TestRemoteConfigValidateMissingURL(c *C) {
config := &RemoteConfig{Name: "foo"}
c.Assert(config.Validate(), Equals, ErrRemoteConfigEmptyURL)