require File.dirname(__FILE__) + '/../../../../../spec_helper' include OpenEHR::AM::Archetype::Ontology describe ArchetypeOntology do before(:each) do terminologies_available = stub(Set, :size =>1) term_codes = stub(Array, :size => 2) constraint_codes = stub(Array, :size => 3) term_attribute_names = stub(Array, :size => 4) @archetype_ontology = ArchetypeOntology.new(:terminologies_available => terminologies_available, :specialisation_depth => 0, :term_codes => term_codes, :constraint_codes => constraint_codes, :term_attribute_names => term_attribute_names) end it 'should be an instance of ArchetypeOntology' do @archetype_ontology.should be_an_instance_of ArchetypeOntology end it 'terminologies_available should be assigned properly' do @archetype_ontology.terminologies_available.size.should be_equal 1 end it 'should raise ArgumentError if terminologies_available is nil' do lambda { @archetype_ontology.terminologies_available = nil }.should raise_error ArgumentError end it 'term_codes should be assigned properly' do @archetype_ontology.term_codes.size.should be_equal 2 end it 'specialisation depth should be assigned properly' do @archetype_ontology.specialisation_depth.should be_equal 0 end it 'constraint_codes should be assigned properly' do @archetype_ontology.constraint_codes.size.should be_equal 3 end it 'term_attribute_names should be assigned properly' do @archetype_ontology.term_attribute_names.size.should be_equal 4 end end