Skip to content

Commit

Permalink
cp_to_blobstore expects a path, not a File
Browse files Browse the repository at this point in the history
Highlighted by this issue: mime-types/ruby-mime-types#127 (comment)

Suggested fix by: @Gerg
  • Loading branch information
johnsonj committed Jan 8, 2018
1 parent 3eadd98 commit 3869ed6
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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}"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 3869ed6

Please sign in to comment.