File tree Expand file tree Collapse file tree 4 files changed +26
-2
lines changed Expand file tree Collapse file tree 4 files changed +26
-2
lines changed Original file line number Diff line number Diff line change @@ -38,7 +38,7 @@ def delete!
3838 private
3939
4040 def internal_download ( local_file )
41- @resource . bucket ( bucket_name ) . object ( key ) . download_file ( local_file )
41+ @client . get_object ( response_target : local_file , bucket : bucket_name , key : key )
4242
4343 local_file
4444 end
Original file line number Diff line number Diff line change 11# frozen_string_literal: true
22
33module CloudStorage
4- VERSION = '0.1.1 '
4+ VERSION = '0.1.2 '
55end
Original file line number Diff line number Diff line change 6262
6363 expect ( content ) . to eq ( "This is a test upload\n " )
6464 end
65+
66+ context 'when 6mb file' do
67+ let ( :file ) { File . open ( 'spec/fixtures/6mb.bin' , 'rb' ) }
68+
69+ it do
70+ expect { content } . not_to ( change { opened_tmp_files_count } )
71+
72+ expect ( content . size ) . to eq ( 6_000_000 )
73+ end
74+ end
6575 end
6676
6777 context 'when download to a custom tmp' do
8393 . to ( "This is a test upload\n " )
8494 . and change { opened_tmp_files_count } . by ( 0 )
8595 end
96+
97+ context 'when 6mb file' do
98+ let ( :file ) { File . open ( 'spec/fixtures/6mb.bin' , 'rb' ) }
99+
100+ it do
101+ tmp
102+
103+ expect { content }
104+ . to change ( tmp , :size )
105+ . from ( 0 )
106+ . to ( 6_000_000 )
107+ . and change { opened_tmp_files_count } . by ( 0 )
108+ end
109+ end
86110 end
87111 end
88112end
You can’t perform that action at this time.
0 commit comments