From 4dab7d2edfc3445422c7d6d27e1a86fb41d19356 Mon Sep 17 00:00:00 2001 From: ramis Date: Fri, 4 Aug 2017 22:43:00 +0300 Subject: [PATCH] Do not clear tests group --- lib/generamba/module_generator.rb | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/generamba/module_generator.rb b/lib/generamba/module_generator.rb index c5a9009..04635dc 100755 --- a/lib/generamba/module_generator.rb +++ b/lib/generamba/module_generator.rb @@ -37,7 +37,8 @@ def generate_module(name, code_module, template) project, code_module.test_targets, code_module.test_group_path, - code_module.test_file_path) + code_module.test_file_path, + [code_module.project_group_path]) end # Saving the current changes in the Xcode project @@ -51,14 +52,14 @@ def generate_module(name, code_module, template) puts "Test group path: #{code_module.test_group_path}".green if code_module.test_group_path end - def process_files_if_needed(files, code_module, template, project, targets, group_path, dir_path) + def process_files_if_needed(files, code_module, template, project, targets, group_path, dir_path, processed_groups = []) # It's possible that current project doesn't test targets configured, so it doesn't need to generate tests. # The same is for files property - a template can have only test or project files if targets.count == 0 || files == nil || files.count == 0 || dir_path == nil || group_path == nil return end - XcodeprojHelper.clear_group(project, targets, group_path) + XcodeprojHelper.clear_group(project, targets, group_path) unless processed_groups.include? group_path files.each do |file| unless file[TEMPLATE_FILE_PATH_KEY] directory_name = file[TEMPLATE_NAME_KEY].gsub(/^\/|\/$/, '')