Skip to content

Commit

Permalink
Merge pull request #193 from RamTararam/develop
Browse files Browse the repository at this point in the history
Do not clear tests group if test_group_path is the same as project_group_path
  • Loading branch information
Brain89 authored Aug 10, 2017
2 parents d7e0e8e + 4dab7d2 commit e2242d2
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions lib/generamba/module_generator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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(/^\/|\/$/, '')
Expand Down

0 comments on commit e2242d2

Please sign in to comment.