From 3869ed6f0d2e9e67c962dd051698911ba79abab4 Mon Sep 17 00:00:00 2001 From: Jeff Johnson Date: Tue, 15 Aug 2017 14:43:44 -0700 Subject: [PATCH] cp_to_blobstore expects a path, not a File Highlighted by this issue: https://github.com/mime-types/ruby-mime-types/issues/127#issuecomment-322597054 Suggested fix by: @Gerg --- .../unit/controllers/internal/listbuildpacks_controller_spec.rb | 2 +- spec/unit/controllers/runtime/buildpack_bits_controller_spec.rb | 2 +- spec/unit/controllers/runtime/buildpacks_controller_spec.rb | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/spec/unit/controllers/internal/listbuildpacks_controller_spec.rb b/spec/unit/controllers/internal/listbuildpacks_controller_spec.rb index 021c574e65d..c7b2b424b21 100644 --- a/spec/unit/controllers/internal/listbuildpacks_controller_spec.rb +++ b/spec/unit/controllers/internal/listbuildpacks_controller_spec.rb @@ -45,7 +45,7 @@ def create_buildpack(key, position, file) context 'with a set of buildpacks' do include TempFileCreator - let(:file) { temp_file_with_content } + let(:file) { temp_file_with_content.path } before do create_buildpack('third-buildpack', 3, file) diff --git a/spec/unit/controllers/runtime/buildpack_bits_controller_spec.rb b/spec/unit/controllers/runtime/buildpack_bits_controller_spec.rb index 348769818ba..159b1b836c8 100644 --- a/spec/unit/controllers/runtime/buildpack_bits_controller_spec.rb +++ b/spec/unit/controllers/runtime/buildpack_bits_controller_spec.rb @@ -70,7 +70,7 @@ module VCAP::CloudController end it 'takes a buildpack file and adds it to the custom buildpacks blobstore with the correct key' do - allow(CloudController::DependencyLocator.instance.upload_handler).to receive(:uploaded_file).and_return(valid_zip) + allow(CloudController::DependencyLocator.instance.upload_handler).to receive(:uploaded_file).and_return(valid_zip.path) buildpack_blobstore = CloudController::DependencyLocator.instance.buildpack_blobstore expected_key = "#{test_buildpack.guid}_#{sha_valid_zip}" diff --git a/spec/unit/controllers/runtime/buildpacks_controller_spec.rb b/spec/unit/controllers/runtime/buildpacks_controller_spec.rb index 0cba02f8df5..705d1cf34f3 100644 --- a/spec/unit/controllers/runtime/buildpacks_controller_spec.rb +++ b/spec/unit/controllers/runtime/buildpacks_controller_spec.rb @@ -152,7 +152,7 @@ def ordered_buildpacks context 'with async false' do before do buildpack_blobstore = CloudController::DependencyLocator.instance.buildpack_blobstore - buildpack_blobstore.cp_to_blobstore(Tempfile.new(['FAKE_BUILDPACK', '.zip']), buildpack1.key) + buildpack_blobstore.cp_to_blobstore(Tempfile.new(['FAKE_BUILDPACK', '.zip']).path, buildpack1.key) end it 'destroys the buildpack entry and enqueues a job to delete the object from the blobstore' do