aboutsummaryrefslogtreecommitdiffstats
path: root/storage/filesystem/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 /storage/filesystem/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 'storage/filesystem/config_test.go')
-rw-r--r--storage/filesystem/config_test.go26
1 files changed, 9 insertions, 17 deletions
diff --git a/storage/filesystem/config_test.go b/storage/filesystem/config_test.go
index 2eb0ab9..b86eaee 100644
--- a/storage/filesystem/config_test.go
+++ b/storage/filesystem/config_test.go
@@ -4,7 +4,6 @@ import (
"io/ioutil"
stdos "os"
- "gopkg.in/src-d/go-git.v4/config"
"gopkg.in/src-d/go-git.v4/fixtures"
"gopkg.in/src-d/go-git.v4/storage/filesystem/internal/dotgit"
"gopkg.in/src-d/go-git.v4/utils/fs/os"
@@ -29,27 +28,20 @@ func (s *ConfigSuite) SetUpTest(c *C) {
s.path = tmp
}
-func (s *ConfigSuite) TestSetRemote(c *C) {
- cfg := &ConfigStorage{s.dir}
- err := cfg.SetRemote(&config.RemoteConfig{Name: "foo", URL: "foo"})
- c.Assert(err, IsNil)
-
- remote, err := cfg.Remote("foo")
- c.Assert(err, IsNil)
- c.Assert(remote.Name, Equals, "foo")
-}
-
func (s *ConfigSuite) TestRemotes(c *C) {
dir := dotgit.New(fixtures.Basic().ByTag(".git").One().DotGit())
- cfg := &ConfigStorage{dir}
+ storer := &ConfigStorage{dir}
- remotes, err := cfg.Remotes()
+ cfg, err := storer.Config()
c.Assert(err, IsNil)
+
+ remotes := cfg.Remotes
c.Assert(remotes, HasLen, 1)
- c.Assert(remotes[0].Name, Equals, "origin")
- c.Assert(remotes[0].URL, Equals, "https://github.com/git-fixtures/basic")
- c.Assert(remotes[0].Fetch, HasLen, 1)
- c.Assert(remotes[0].Fetch[0].String(), Equals, "+refs/heads/*:refs/remotes/origin/*")
+ remote := remotes["origin"]
+ c.Assert(remote.Name, Equals, "origin")
+ c.Assert(remote.URL, Equals, "https://github.com/git-fixtures/basic")
+ c.Assert(remote.Fetch, HasLen, 1)
+ c.Assert(remote.Fetch[0].String(), Equals, "+refs/heads/*:refs/remotes/origin/*")
}
func (s *ConfigSuite) TearDownTest(c *C) {