File tree Expand file tree Collapse file tree 2 files changed +11
-4
lines changed Expand file tree Collapse file tree 2 files changed +11
-4
lines changed Original file line number Diff line number Diff line change @@ -202,13 +202,13 @@ def compile(*args)
202202 logger . debug "Skipping #{ target } .gz, already exists"
203203 else
204204 logger . info "Writing #{ target } .gz"
205- concurrent_compressors << Concurrent ::Future . execute { write_file . wait ; gzip . compress ( target ) }
205+ concurrent_compressors << Concurrent ::Future . execute { write_file . wait! ; gzip . compress ( target ) }
206206 end
207207
208208 end
209- concurrent_writers . each ( &:wait )
210- concurrent_compressors . each ( &:wait )
211- Concurrent :: Future . execute { self . save } . wait
209+ concurrent_writers . each ( &:wait! )
210+ concurrent_compressors . each ( &:wait! )
211+ save
212212
213213 filenames
214214 end
Original file line number Diff line number Diff line change @@ -657,4 +657,11 @@ def teardown
657657 refute File . exist? ( "#{ @dir } /#{ original_path } .gz" ) , "Expecting '#{ original_path } ' to not generate gzipped file: '#{ original_path } .gz' but it did"
658658 end
659659 end
660+
661+ test 'raises exception when gzip fails' do
662+ manifest = Sprockets ::Manifest . new ( @env , @dir )
663+ Zlib ::GzipWriter . stub ( :new , -> { fail 'kaboom' } ) do
664+ assert_raises ( 'kaboom' ) { manifest . compile ( 'application.js' ) }
665+ end
666+ end
660667end
You can’t perform that action at this time.
0 commit comments