Merge pull request #330 from joker1007/enable-upload-to-use-tempfile

Add Tempfile to if statement of BaseUploadCommand#prepare!
This commit is contained in:
Steve Bazyl committed 2016-01-06 12:02:56 -08:00
commit a0d99ba253
2 files changed
+21 -1

No files matched your search

+14
View File
@@ -129,6 +129,20 @@ RSpec.describe Google::Apis::Core::RawUploadCommand do
end
end
context('with Tempfile input') do
let(:file) do
temp_file = Tempfile.new("tempfile")
temp_file.write("Hello world\n")
temp_file.rewind
temp_file
end
include_examples 'should upload'
it 'should not close stream' do
expect(file.closed?).to be false
end
end
context('with file path input') do
let(:file) { File.join(FIXTURES_DIR, 'files', 'test.txt') }
include_examples 'should upload'