mirror of
https://github.com/ThrowTheSwitch/CMock.git
synced 2026-08-14 07:07:49 +00:00
- make config from yaml equally happy with symbols or strings (particularly for plugins)
git-svn-id: http://cmock.svn.sourceforge.net/svnroot/cmock/trunk@172 bf332499-1b4d-0410-844d-d2d48d5cc64c
This commit is contained in:
+3
-2
@@ -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
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user