mirror of
https://github.com/ThrowTheSwitch/CMock.git
synced 2026-08-19 01:29:57 +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)
|
puts "WARNING: :#{opt.to_s} should be an array." unless (options[:verbosity] < 1)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
options[:plugins].compact!
|
||||||
|
options[:plugins].map! {|p| p.to_sym}
|
||||||
@options = options
|
@options = options
|
||||||
@options[:treat_as].merge!(standard_treat_as_map)
|
@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
|
end
|
||||||
|
|
||||||
def load_config_file_from_yaml yaml_filename
|
def load_config_file_from_yaml yaml_filename
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ class CMockConfigTest < Test::Unit::TestCase
|
|||||||
end
|
end
|
||||||
|
|
||||||
should "replace only options specified in a yaml file" do
|
should "replace only options specified in a yaml file" do
|
||||||
test_plugins = ['soda','pizza']
|
test_plugins = [:soda, :pizza]
|
||||||
test_include = 'MySillyException.h'
|
test_include = 'MySillyException.h'
|
||||||
config = CMockConfig.new("#{File.expand_path(File.dirname(__FILE__))}/cmock_config_test.yml")
|
config = CMockConfig.new("#{File.expand_path(File.dirname(__FILE__))}/cmock_config_test.yml")
|
||||||
assert_equal(CMockConfig::CMockDefaultOptions[:mock_path], config.mock_path)
|
assert_equal(CMockConfig::CMockDefaultOptions[:mock_path], config.mock_path)
|
||||||
|
|||||||
Reference in New Issue
Block a user