Skip to content

Commit

Permalink
packages renames to *fs to avoid name colisions
Browse files Browse the repository at this point in the history
  • Loading branch information
mcuadros committed Jan 30, 2017
1 parent 97730a4 commit 1dfacf9
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 12 deletions.
4 changes: 2 additions & 2 deletions memory/memory.go → memfs/memory.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Package memory provides a billy filesystem base on meomry.
package memory // import "srcd.works/go-billy.v1/memory"
// Package memfs provides a billy filesystem base on memory.
package memfs // import "srcd.works/go-billy.v1/memfs"

import (
"errors"
Expand Down
2 changes: 1 addition & 1 deletion memory/memory_test.go → memfs/memory_test.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package memory
package memfs

import (
"testing"
Expand Down
2 changes: 1 addition & 1 deletion os/os.go → osfs/os.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Package os provides a billy filesystem for the OS.
package os // import "srcd.works/go-billy.v1/os"
package osfs // import "srcd.works/go-billy.v1/osfs"

import (
"io/ioutil"
Expand Down
15 changes: 7 additions & 8 deletions os/os_test.go → osfs/os_test.go
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
package os_test
package osfs

import (
"io/ioutil"
stdos "os"
"os"
"path/filepath"
"testing"

. "gopkg.in/check.v1"
"srcd.works/go-billy.v1/os"
"srcd.works/go-billy.v1/test"
)

Expand All @@ -21,17 +20,17 @@ type OSSuite struct {
var _ = Suite(&OSSuite{})

func (s *OSSuite) SetUpTest(c *C) {
s.path, _ = ioutil.TempDir(stdos.TempDir(), "go-git-os-fs-test")
s.FilesystemSuite.Fs = os.New(s.path)
s.path, _ = ioutil.TempDir(os.TempDir(), "go-git-os-fs-test")
s.FilesystemSuite.Fs = New(s.path)
}
func (s *OSSuite) TearDownTest(c *C) {
err := stdos.RemoveAll(s.path)
err := os.RemoveAll(s.path)
c.Assert(err, IsNil)
}

func (s *OSSuite) TestOpenDoesNotCreateDir(c *C) {
_, err := s.Fs.Open("dir/non-existent")
c.Assert(err, NotNil)
_, err = stdos.Stat(filepath.Join(s.path, "dir"))
c.Assert(stdos.IsNotExist(err), Equals, true)
_, err = os.Stat(filepath.Join(s.path, "dir"))
c.Assert(os.IsNotExist(err), Equals, true)
}

0 comments on commit 1dfacf9

Please sign in to comment.