@@ -131,8 +131,8 @@ module CNB
131131
132132 let ( :buildpacks ) do
133133 [
134- { url : 'gcr.io/paketo-buildpacks/node-start' , skip_detect : false } ,
135- { url : 'gcr.io/paketo-buildpacks/node-engine' , skip_detect : false }
134+ { name : 'custom' , url : 'gcr.io/paketo-buildpacks/node-start' , skip_detect : false } ,
135+ { name : 'custom' , url : 'gcr.io/paketo-buildpacks/node-engine' , skip_detect : false }
136136 ]
137137 end
138138
@@ -240,6 +240,52 @@ module CNB
240240 end
241241 end
242242 end
243+
244+ context ( 'when system-buildpaks are used' ) do
245+ let ( :buildpacks ) do
246+ [
247+ { name : 'node-cnb' , key : 'node-key' , skip_detect : false } ,
248+ { name : 'java-cnb' , key : 'java-key' , skip_detect : false }
249+ ]
250+ end
251+
252+ let ( :run_staging_action ) do
253+ ::Diego ::Bbs ::Models ::RunAction . new (
254+ path : '/tmp/lifecycle/builder' ,
255+ user : 'vcap' ,
256+ args : [ '--cache-dir' , '/tmp/cache' , '--cache-output' , '/tmp/cache-output.tgz' , '--system-buildpack' , 'node-key' , '--system-buildpack' ,
257+ 'java-key' , '--pass-env-var' , 'FOO' , '--pass-env-var' , 'BAR' ] ,
258+ env : bbs_env
259+ )
260+ end
261+
262+ it 'returns the buildpack staging action without download actions' do
263+ result = builder . action
264+
265+ serial_action = result . serial_action
266+ actions = serial_action . actions
267+
268+ expect ( actions [ 1 ] . run_action ) . to eq ( run_staging_action )
269+ expect ( builder . cached_dependencies ) . to include ( ::Diego ::Bbs ::Models ::CachedDependency . new (
270+ name : 'node-cnb' ,
271+ from : '' ,
272+ to : '/tmp/buildpacks/54548f35489d6234' ,
273+ cache_key : 'node-cnb' ,
274+ log_source : '' ,
275+ checksum_algorithm : '' ,
276+ checksum_value : ''
277+ ) )
278+ expect ( builder . cached_dependencies ) . to include ( ::Diego ::Bbs ::Models ::CachedDependency . new (
279+ name : 'java-cnb' ,
280+ from : '' ,
281+ to : '/tmp/buildpacks/c56b3bfdba7aa4dd' ,
282+ cache_key : 'java-cnb' ,
283+ log_source : '' ,
284+ checksum_algorithm : '' ,
285+ checksum_value : ''
286+ ) )
287+ end
288+ end
243289 end
244290
245291 describe '#cached_dependencies' do
0 commit comments