From 02b08380861be0e2c532cd87d2d67058bd472c89 Mon Sep 17 00:00:00 2001 From: Austin Glaser Date: Thu, 21 Apr 2016 16:12:11 -0600 Subject: [PATCH 1/2] cmock handles multiple helper headers --- lib/cmock_config.rb | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/cmock_config.rb b/lib/cmock_config.rb index 7b15858..b55ca79 100644 --- a/lib/cmock_config.rb +++ b/lib/cmock_config.rb @@ -84,8 +84,11 @@ class CMockConfig end def load_unity_helper - return File.new(@options[:unity_helper_path]).read if (@options[:unity_helper_path]) - return nil + return nil unless (@options[:unity_helper_path]) + + return @options[:unity_helper_path].inject("") do |unity_helper, filename| + unity_helper + "\n" + File.new(filename).read + end end def standard_treat_as_map From 6545913260e8749cc69418e0922c09bd3c649914 Mon Sep 17 00:00:00 2001 From: Austin Glaser Date: Thu, 21 Apr 2016 17:31:26 -0600 Subject: [PATCH 2/2] arrayify helper path within cmock --- lib/cmock_config.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/cmock_config.rb b/lib/cmock_config.rb index b55ca79..1517b65 100644 --- a/lib/cmock_config.rb +++ b/lib/cmock_config.rb @@ -58,6 +58,7 @@ class CMockConfig end end options[:unity_helper_path] ||= options[:unity_helper] + options[:unity_helper_path] = [options[:unity_helper_path]] if options[:unity_helper_path].is_a? String options[:plugins].compact! options[:plugins].map! {|p| p.to_sym} @options = options