Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do not clear tests group if test_group_path is the same as project_group_path #193

Merged
merged 1 commit into from
Aug 10, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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