diff --git a/lib/cmock_config.rb b/lib/cmock_config.rb index 1f1bbb3..b9bf444 100644 --- a/lib/cmock_config.rb +++ b/lib/cmock_config.rb @@ -44,10 +44,11 @@ class CMockConfig puts "WARNING: :#{opt.to_s} should be an array." unless (options[:verbosity] < 1) end end - + options[:plugins].compact! + options[:plugins].map! {|p| p.to_sym} @options = options @options[:treat_as].merge!(standard_treat_as_map) - @options.each_key { |key| eval("def #{key}() return @options[:#{key}] end") } + @options.each_key { |key| eval("def #{key.to_s}() return @options[:#{key.to_s}] end") } end def load_config_file_from_yaml yaml_filename diff --git a/test/unit/cmock_config_test.rb b/test/unit/cmock_config_test.rb index 04007e5..bafd544 100644 --- a/test/unit/cmock_config_test.rb +++ b/test/unit/cmock_config_test.rb @@ -35,7 +35,7 @@ class CMockConfigTest < Test::Unit::TestCase end should "replace only options specified in a yaml file" do - test_plugins = ['soda','pizza'] + test_plugins = [:soda, :pizza] test_include = 'MySillyException.h' config = CMockConfig.new("#{File.expand_path(File.dirname(__FILE__))}/cmock_config_test.yml") assert_equal(CMockConfig::CMockDefaultOptions[:mock_path], config.mock_path)