11# =========================================================================
22# Unity - A Test Framework for C
33# ThrowTheSwitch.org
4- # Copyright (c) 2007-25 Mike Karlesky, Mark VanderVoord, & Greg Williams
4+ # Copyright (c) 2007-26 Mike Karlesky, Mark VanderVoord, & Greg Williams
55# SPDX-License-Identifier: MIT
66# =========================================================================
77
@@ -53,7 +53,7 @@ class UnityModuleGenerator
5353 def initialize ( options = nil )
5454 @options = UnityModuleGenerator . default_options
5555 case options
56- when NilClass then @options
56+ when NilClass then nil # leave @options unchanged
5757 when String then @options . merge! ( UnityModuleGenerator . grab_config ( options ) )
5858 when Hash then @options . merge! ( options )
5959 else raise 'If you specify arguments, it should be a filename or a hash of options'
@@ -158,10 +158,10 @@ def files_to_operate_on(module_name, pattern = nil)
158158 template : cfg [ :template ] ,
159159 test_define : cfg [ :test_define ] ,
160160 boilerplate : cfg [ :boilerplate ] ,
161- includes : case ( cfg [ :inc ] )
162- when :src then ( @options [ :includes ] [ :src ] || [ ] ) | ( pattern_traits [ :inc ] . map { |f | format ( f , module_name ) } )
161+ includes : case cfg [ :inc ]
162+ when :src then ( @options [ :includes ] [ :src ] || [ ] ) | pattern_traits [ :inc ] . map { |f | format ( f , module_name ) }
163163 when :inc then @options [ :includes ] [ :inc ] || [ ]
164- when :tst then ( @options [ :includes ] [ :tst ] || [ ] ) | ( pattern_traits [ :inc ] . map { |f | format ( "#{ @options [ :mock_prefix ] } #{ f } " , module_name ) } )
164+ when :tst then ( @options [ :includes ] [ :tst ] || [ ] ) | pattern_traits [ :inc ] . map { |f | format ( "#{ @options [ :mock_prefix ] } #{ f } " , module_name ) }
165165 end
166166 }
167167 end
@@ -182,7 +182,7 @@ def neutralize_filename(name, start_cap: true)
182182 ############################
183183 def create_filename ( part1 , part2 = '' )
184184 name = part2 . empty? ? part1 : "#{ part1 } _#{ part2 } "
185- case ( @options [ :naming ] )
185+ case @options [ :naming ]
186186 when 'bumpy' then neutralize_filename ( name , start_cap : false ) . delete ( '_' )
187187 when 'camel' then neutralize_filename ( name ) . delete ( '_' )
188188 when 'snake' then neutralize_filename ( name ) . downcase
0 commit comments