| Index: client/cipd/local/fs_test.go
|
| diff --git a/client/cipd/local/fs_test.go b/client/cipd/local/fs_test.go
|
| index c872681d16fe33afb0e9af8c48bd59bd7455d92b..b95881194fd5bc8d5b56424b953adbd2beef3ce0 100644
|
| --- a/client/cipd/local/fs_test.go
|
| +++ b/client/cipd/local/fs_test.go
|
| @@ -122,18 +122,18 @@ func TestEnsureSymlink(t *testing.T) {
|
| func TestEnsureFile(t *testing.T) {
|
| Convey("EnsureFile checks root", t, func() {
|
| fs := tempFileSystem()
|
| - So(fs.EnsureFile(fs.join(".."), strings.NewReader("blah")), ShouldNotBeNil)
|
| + So(EnsureFile(fs, fs.join(".."), strings.NewReader("blah")), ShouldNotBeNil)
|
| })
|
|
|
| Convey("EnsureFile creates new file", t, func() {
|
| fs := tempFileSystem()
|
| - So(fs.EnsureFile(fs.join("name"), strings.NewReader("blah")), ShouldBeNil)
|
| + So(EnsureFile(fs, fs.join("name"), strings.NewReader("blah")), ShouldBeNil)
|
| So(fs.read("name"), ShouldEqual, "blah")
|
| })
|
|
|
| Convey("EnsureFile builds full path", t, func() {
|
| fs := tempFileSystem()
|
| - So(fs.EnsureFile(fs.join("a/b/c"), strings.NewReader("blah")), ShouldBeNil)
|
| + So(EnsureFile(fs, fs.join("a/b/c"), strings.NewReader("blah")), ShouldBeNil)
|
| So(fs.read("a/b/c"), ShouldEqual, "blah")
|
| })
|
|
|
| @@ -141,22 +141,22 @@ func TestEnsureFile(t *testing.T) {
|
| Convey("EnsureFile replaces existing symlink", t, func() {
|
| fs := tempFileSystem()
|
| So(fs.EnsureSymlink(fs.join("path"), "target"), ShouldBeNil)
|
| - So(fs.EnsureFile(fs.join("path"), strings.NewReader("blah")), ShouldBeNil)
|
| + So(EnsureFile(fs, fs.join("path"), strings.NewReader("blah")), ShouldBeNil)
|
| So(fs.read("path"), ShouldEqual, "blah")
|
| })
|
| }
|
|
|
| Convey("EnsureFile replaces existing file", t, func() {
|
| fs := tempFileSystem()
|
| - So(fs.EnsureFile(fs.join("path"), strings.NewReader("huh")), ShouldBeNil)
|
| - So(fs.EnsureFile(fs.join("path"), strings.NewReader("blah")), ShouldBeNil)
|
| + So(EnsureFile(fs, fs.join("path"), strings.NewReader("huh")), ShouldBeNil)
|
| + So(EnsureFile(fs, fs.join("path"), strings.NewReader("blah")), ShouldBeNil)
|
| So(fs.read("path"), ShouldEqual, "blah")
|
| })
|
|
|
| Convey("EnsureFile replaces existing directory", t, func() {
|
| fs := tempFileSystem()
|
| fs.write("a/b/c", "something")
|
| - So(fs.EnsureFile(fs.join("a"), strings.NewReader("blah")), ShouldBeNil)
|
| + So(EnsureFile(fs, fs.join("a"), strings.NewReader("blah")), ShouldBeNil)
|
| So(fs.read("a"), ShouldEqual, "blah")
|
| })
|
| }
|
|
|