ontology_factory.rb revision 22f8827cd8892a298f9764ce862db6867307828d
basepath: ontology.basepath, file_extension: ontology.file_extension ontology.versions << version after(:build) do |ontology| version = build :ontology_version, basepath: ontology.basepath, file_extension: ontology.file_extension, ontology.versions << version factory :single_unparsed_ontology do |ontology| ontology.after(:build) do |ontology| version = build :ontology_version, basepath: ontology.basepath, file_extension: ontology.file_extension version.fast_parse = true ontology.versions << version factory :single_ontology, class: SingleOntology do factory :distributed_ontology, class: DistributedOntology do # Should always be fully linked, so every child should # have a linked (defined by the DO) pointing or sourcing factory :linked_distributed_ontology do |ontology| ontology.after(:build) do |ontology| logic = FactoryGirl.create(:logic) child_one = FactoryGirl.create(:ontology, repository: ontology.repository) child_two = FactoryGirl.create(:ontology, repository: ontology.repository) FactoryGirl.create(:mapping, ontology.children.push(child_one, child_two) after(:build) do |built_ontology| built_ontology.children << FactoryGirl.build(:ontology, repository: built_ontology.repository, basepath: built_ontology.basepath, file_extension: built_ontology.file_extension) built_ontology.children << FactoryGirl.build(:ontology, repository: built_ontology.repository, basepath: built_ontology.basepath, file_extension: built_ontology.file_extension) trait :with_versioned_children do after(:build) do |ontology| version = build :ontology_version, basepath: ontology.basepath, file_extension: ontology.file_extension version.fast_parse = true ontology.versions << version logic = FactoryGirl.create(:logic) child_one = FactoryGirl.build(:ontology, :with_version, basepath: ontology.basepath, file_extension: ontology.file_extension, repository: ontology.repository) child_one.versions.first.parent = version child_two = FactoryGirl.build(:ontology, :with_version, basepath: ontology.basepath, file_extension: ontology.file_extension, repository: ontology.repository) child_two.versions.first.parent = version FactoryGirl.create(:mapping, factory :heterogeneous_ontology do |ontology| ontology.after(:build) do |ontology| logic_one = FactoryGirl.create(:logic) logic_two = FactoryGirl.create(:logic) ontology.children << FactoryGirl.build(:ontology, repository: ontology.repository) ontology.children << FactoryGirl.build(:ontology, repository: ontology.repository) factory :homogeneous_ontology do |ontology| ontology.after(:build) do |ontology| logic_one = FactoryGirl.create(:logic) ontology.children << FactoryGirl.create(:ontology, repository: ontology.repository) ontology.children << FactoryGirl.create(:ontology, repository: ontology.repository)