diff options
author | Máximo Cuadros <mcuadros@gmail.com> | 2017-01-31 12:00:40 +0100 |
---|---|---|
committer | Máximo Cuadros <mcuadros@gmail.com> | 2017-01-31 12:00:40 +0100 |
commit | 387683bbcf40ed48e0f1ad0884970712f9682b9e (patch) | |
tree | c13eee66eb19b4126d69543312efa12c7a7d389f /remote_test.go | |
parent | f7da595e8aef658cd3dfed897b84ada2b0eac921 (diff) | |
download | go-git-387683bbcf40ed48e0f1ad0884970712f9682b9e.tar.gz |
config: RefSpec.Validate returning errors and doc (Fixes #232)
Diffstat (limited to 'remote_test.go')
-rw-r--r-- | remote_test.go | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/remote_test.go b/remote_test.go index 1e3a2d8..1e34905 100644 --- a/remote_test.go +++ b/remote_test.go @@ -7,8 +7,8 @@ import ( "io/ioutil" "os" - "srcd.works/go-git.v4/config" "github.com/src-d/go-git-fixtures" + "srcd.works/go-git.v4/config" "srcd.works/go-git.v4/plumbing" "srcd.works/go-git.v4/plumbing/storer" "srcd.works/go-git.v4/storage/filesystem" @@ -46,7 +46,7 @@ func (s *RemoteSuite) TestFetchInvalidFetchOptions(c *C) { r := newRemote(nil, &config.RemoteConfig{Name: "foo", URL: "qux://foo"}) invalid := config.RefSpec("^*$ñ") err := r.Fetch(&FetchOptions{RefSpecs: []config.RefSpec{invalid}}) - c.Assert(err, Equals, ErrInvalidRefSpec) + c.Assert(err, Equals, config.ErrRefSpecMalformedSeparator) } func (s *RemoteSuite) TestFetch(c *C) { @@ -287,7 +287,7 @@ func (s *RemoteSuite) TestPushInvalidFetchOptions(c *C) { r := newRemote(nil, &config.RemoteConfig{Name: "foo", URL: "qux://foo"}) invalid := config.RefSpec("^*$ñ") err := r.Push(&PushOptions{RefSpecs: []config.RefSpec{invalid}}) - c.Assert(err, Equals, ErrInvalidRefSpec) + c.Assert(err, Equals, config.ErrRefSpecMalformedSeparator) } func (s *RemoteSuite) TestPushInvalidRefSpec(c *C) { @@ -300,7 +300,7 @@ func (s *RemoteSuite) TestPushInvalidRefSpec(c *C) { err := r.Push(&PushOptions{ RefSpecs: []config.RefSpec{rs}, }) - c.Assert(err, ErrorMatches, ".*invalid.*") + c.Assert(err, Equals, config.ErrRefSpecMalformedSeparator) } func (s *RemoteSuite) TestPushWrongRemoteName(c *C) { |