snappy/remove_test.go: add missing test

This commit is contained in:
Michael Vogt
2015-02-10 16:39:53 +01:00
parent 5b89a525a7
commit a2b7ab355d
2 changed files with 15 additions and 1 deletions

View File

@@ -10,6 +10,6 @@ func Remove(partName string) error {
if err := part.Uninstall(); err != nil {
return err
}
return nil
}

14
snappy/remove_test.go Normal file
View File

@@ -0,0 +1,14 @@
package snappy
import (
"fmt"
. "launchpad.net/gocheck"
)
func (s *SnapTestSuite) TestRemoveNonExistingRaisesError(c *C) {
pkgName := "some-random-non-existing-stuff"
err := Remove(pkgName)
c.Assert(err, NotNil)
c.Assert(err.Error(), Equals, fmt.Sprintf("Can not find snap %s", pkgName))
}