@@ -60,17 +60,6 @@ var _ = Describe("Externalbuilders", func() {
60
60
Expect (err ).NotTo (HaveOccurred ())
61
61
})
62
62
63
- Context ("when the tmp dir cannot be created" , func () {
64
- BeforeEach (func () {
65
- ccci .PackageID = "/"
66
- })
67
-
68
- It ("returns an error" , func () {
69
- _ , err := externalbuilders .NewBuildContext (ccci , codePackage )
70
- Expect (err ).To (MatchError (ContainSubstring ("could not create temp dir" )))
71
- })
72
- })
73
-
74
63
Context ("when the archive cannot be extracted" , func () {
75
64
BeforeEach (func () {
76
65
var err error
@@ -84,6 +73,16 @@ var _ = Describe("Externalbuilders", func() {
84
73
Expect (err ).To (MatchError (ContainSubstring ("could not untar source package" )))
85
74
})
86
75
})
76
+
77
+ Context ("when package id contains inappropriate chars" , func () {
78
+ It ("replaces them with dash" , func () {
79
+ ccci .PackageID = "i&am/pkg:id"
80
+
81
+ buildContext , err := externalbuilders .NewBuildContext (ccci , codePackage )
82
+ Expect (err ).NotTo (HaveOccurred ())
83
+ Expect (buildContext .ScratchDir ).To (ContainSubstring ("fabric-i-am-pkg-id" ))
84
+ })
85
+ })
87
86
})
88
87
89
88
Describe ("Detector" , func () {
@@ -103,17 +102,6 @@ var _ = Describe("Externalbuilders", func() {
103
102
Expect (instance .(* externalbuilders.Instance ).Builder ).To (Equal (& externalbuilders.Builder {Location : "testdata" }))
104
103
})
105
104
106
- Context ("when the build context cannot be created" , func () {
107
- BeforeEach (func () {
108
- ccci .PackageID = "/"
109
- })
110
-
111
- It ("returns an error" , func () {
112
- _ , err := detector .Build (ccci , codePackageBytes )
113
- Expect (err ).To (MatchError (ContainSubstring ("could not create build context" )))
114
- })
115
- })
116
-
117
105
Context ("when no builder can be found" , func () {
118
106
BeforeEach (func () {
119
107
detector .Builders = nil
0 commit comments