1
// Copyright 2014 Canonical Ltd.
2
// Licensed under the LGPLv3, see LICENCE file for details.
11
jc "github.com/juju/testing/checkers"
12
gc "gopkg.in/check.v1"
15
type isNotExistSuite struct{}
17
var _ = gc.Suite(&isNotExistSuite{})
19
func (*isNotExistSuite) TestIsNotExist(c *gc.C) {
21
path := func(s string) string { return filepath.Join(dir, s) }
22
err := ioutil.WriteFile(path("file"), []byte("blah"), 0644)
23
c.Assert(err, gc.IsNil)
25
_, err = os.Lstat(path("noexist"))
26
c.Assert(err, jc.Satisfies, isNotExist)
28
_, err = os.Lstat(path("file/parent-not-a-dir"))
29
c.Assert(err, jc.Satisfies, isNotExist)