From 3cfa43746023775ce70b2810de71a8f4f21b1bbb Mon Sep 17 00:00:00 2001 From: mvandervoord Date: Thu, 12 Mar 2020 17:08:51 -0400 Subject: [PATCH] Make skeleton path configurable --- lib/cmock_config.rb | 1 + lib/cmock_file_writer.rb | 2 +- test/system/test_interactions/skeleton.yml | 1 + test/system/test_interactions/skeleton_update.yml | 1 + 4 files changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/cmock_config.rb b/lib/cmock_config.rb index caf287f..bcb5a38 100644 --- a/lib/cmock_config.rb +++ b/lib/cmock_config.rb @@ -12,6 +12,7 @@ class CMockConfig :mock_path => 'mocks', :mock_prefix => 'Mock', :mock_suffix => '', + :skeleton_path => '', :weak => '', :subdir => nil, :plugins => [], diff --git a/lib/cmock_file_writer.rb b/lib/cmock_file_writer.rb index d3680c0..c9dae81 100644 --- a/lib/cmock_file_writer.rb +++ b/lib/cmock_file_writer.rb @@ -35,7 +35,7 @@ class CMockFileWriter def append_file(filename, subdir) raise "Where's the block of data to create?" unless block_given? - full_file_name = "#{@config.mock_path}/#{subdir+'/' if subdir}#{filename}" + full_file_name = "#{@config.skeleton_path}/#{subdir+'/' if subdir}#{filename}" File.open(full_file_name, 'a') do |file| yield(file, filename) end diff --git a/test/system/test_interactions/skeleton.yml b/test/system/test_interactions/skeleton.yml index d1b22a1..7720800 100644 --- a/test/system/test_interactions/skeleton.yml +++ b/test/system/test_interactions/skeleton.yml @@ -2,6 +2,7 @@ :cmock: :plugins: - # none + :skeleton_path: system/generated :systest: :types: | diff --git a/test/system/test_interactions/skeleton_update.yml b/test/system/test_interactions/skeleton_update.yml index 463f9ba..757e8b1 100644 --- a/test/system/test_interactions/skeleton_update.yml +++ b/test/system/test_interactions/skeleton_update.yml @@ -2,6 +2,7 @@ :cmock: :plugins: - # none + :skeleton_path: system/generated :systest: :types: |