File tree Expand file tree Collapse file tree 3 files changed +8
-4
lines changed
Expand file tree Collapse file tree 3 files changed +8
-4
lines changed Original file line number Diff line number Diff line change 577577 logger
578578 ruby2_keywords (0.0.5 )
579579 rubyzip (2.4.1 )
580- sablon (0.3.2 )
580+ sablon (0.4.3 )
581581 nokogiri (>= 1.8.5 )
582- rubyzip (>= 1.1.1 )
582+ rubyzip (>= 1.3.0 )
583583 safe_shell (1.1.0 )
584584 sanitize (7.0.0 )
585585 crass (~> 1.0.2 )
Original file line number Diff line number Diff line change @@ -7,6 +7,9 @@ class CaseCourtReport
77
88 def initialize ( path_to_template :, context :)
99 @context = context
10+ # Validate template exists before processing (sablon 0.4+ no longer raises Zip::Error)
11+ raise Zip ::Error , "Template file not found: #{ path_to_template } " unless File . exist? ( path_to_template )
12+
1013 # NOTE: this is what is used for docx templates
1114 @template = Sablon . template ( path_to_template )
1215 end
Original file line number Diff line number Diff line change 393393 path_to_template : nonexistent_path
394394 }
395395 context = CaseCourtReportContext . new ( args ) . context
396- bad_report = CaseCourtReport . new ( path_to_template : nonexistent_path , context : context )
397- expect { bad_report . generate_to_string } . to raise_error ( Zip ::Error )
396+ expect {
397+ CaseCourtReport . new ( path_to_template : nonexistent_path , context : context )
398+ } . to raise_error ( Zip ::Error , /Template file not found/ )
398399 end
399400 end
400401
You can’t perform that action at this time.
0 commit comments