fixed issues after refactor, spec passing

This commit is contained in:
James Lopez 2016-05-09 11:10:12 +02:00
parent 8ac53eb5d0
commit 3aee167dcc
2 changed files with 6 additions and 6 deletions

View File

@ -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

View File

@ -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