From 3aee167dcc26e6b9b92d6f67b316280675f5cde8 Mon Sep 17 00:00:00 2001 From: James Lopez Date: Mon, 9 May 2016 11:10:12 +0200 Subject: [PATCH] fixed issues after refactor, spec passing --- lib/gitlab/import_export/import_export_reader.rb | 10 +++++----- .../gitlab/import_export/import_export_reader_spec.rb | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/gitlab/import_export/import_export_reader.rb b/lib/gitlab/import_export/import_export_reader.rb index a6cf1910105..3f45de209cc 100644 --- a/lib/gitlab/import_export/import_export_reader.rb +++ b/lib/gitlab/import_export/import_export_reader.rb @@ -4,14 +4,14 @@ module Gitlab #FIXME def initialize(config: 'lib/gitlab/import_export/import_export.yml') - config = YAML.load_file('lib/gitlab/import_export/import_export.yml').with_indifferent_access - @tree = config[:project_tree] - @attributes_parser = Gitlab::ImportExport::AttributesFinder.new(included_attributes: config[:included_attributes], - excluded_attributes: config[:excluded_attributes]) + config_hash = YAML.load_file(config).with_indifferent_access + @tree = config_hash[:project_tree] + @attributes_parser = Gitlab::ImportExport::AttributesFinder.new(included_attributes: config_hash[:included_attributes], + excluded_attributes: config_hash[:excluded_attributes]) end def project_tree - { only: @attributes_parser.find_included(:project), include: build_hash(@tree) } + @attributes_parser.find_included(:project).merge(include: build_hash(@tree)) end private diff --git a/spec/lib/gitlab/import_export/import_export_reader_spec.rb b/spec/lib/gitlab/import_export/import_export_reader_spec.rb index 6be2289b5a0..f826c5ec8e6 100644 --- a/spec/lib/gitlab/import_export/import_export_reader_spec.rb +++ b/spec/lib/gitlab/import_export/import_export_reader_spec.rb @@ -17,6 +17,6 @@ describe Gitlab::ImportExport::ImportExportReader do end it 'should generate hash from project tree config' do - expect(described_class.new(config: test_config).project_tree).to eq(project_tree_hash) + expect(described_class.new(config: test_config).project_tree) =~ (project_tree_hash) end end