@@ -649,7 +649,22 @@ plugs:
649649` )
650650 var buf bytes.Buffer
651651 err := pack .CheckSkeleton (& buf , sourceDir )
652- c .Assert (err , ErrorMatches , `content interface plug "shared-data" has target "\$SNAP/import" which does not exist` )
652+ c .Assert (err , ErrorMatches , `content interface plug "shared-data" target "\$SNAP/import" does not exist` )
653+ }
654+
655+ func (s * packSuite ) TestCheckSkeletonContentPlugTargetNotDirectory (c * C ) {
656+ sourceDir := makeExampleSnapSourceDir (c , `name: hello
657+ version: 0
658+ base: core26
659+ plugs:
660+ shared-data:
661+ interface: content
662+ target: $SNAP/import
663+ ` )
664+ c .Assert (os .WriteFile (filepath .Join (sourceDir , "import" ), []byte ("" ), 0644 ), IsNil )
665+ var buf bytes.Buffer
666+ err := pack .CheckSkeleton (& buf , sourceDir )
667+ c .Assert (err , ErrorMatches , `content interface plug "shared-data" target "\$SNAP/import" must be a directory` )
653668}
654669
655670func (s * packSuite ) TestCheckSkeletonContentPlugTargetOldBaseSkipped (c * C ) {
@@ -710,7 +725,7 @@ plugs:
710725` )
711726 var buf bytes.Buffer
712727 err := pack .CheckSkeleton (& buf , sourceDir )
713- c .Assert (err , ErrorMatches , `content interface plug "shared-data" has target "import" which does not exist` )
728+ c .Assert (err , ErrorMatches , `content interface plug "shared-data" target "import" does not exist` )
714729}
715730
716731func (s * packSuite ) TestCheckSkeletonContentPlugTargetMultiplePlugs (c * C ) {
@@ -728,5 +743,5 @@ plugs:
728743 c .Assert (os .Mkdir (filepath .Join (sourceDir , "existing" ), 0755 ), IsNil )
729744 var buf bytes.Buffer
730745 err := pack .CheckSkeleton (& buf , sourceDir )
731- c .Assert (err , ErrorMatches , `content interface plug "plug-missing" has target "\$SNAP/missing" which does not exist` )
746+ c .Assert (err , ErrorMatches , `content interface plug "plug-missing" target "\$SNAP/missing" does not exist` )
732747}
0 commit comments