spec/lib/openehr/parser/adl_parser_spec.rb in openehr-1.2.7 vs spec/lib/openehr/parser/adl_parser_spec.rb in openehr-1.2.8

- old
+ new

@@ -1,35 +1,30 @@ require File.dirname(__FILE__) + '/../../../spec_helper' -include OpenEHR::Parser -include OpenEHR::AM::Archetype -include OpenEHR::AM::Archetype::ConstraintModel -include OpenEHR::AM::Archetype::Assertion -include OpenEHR::AM::Archetype::Ontology -describe ADLParser do +describe OpenEHR::Parser::ADLParser do before (:all) do @adl_dir = File.dirname(__FILE__) + '/adl14/' end context 'openEHR-EHR-SECTION-summary.v1.adl' do before(:all) do - @ap = ADLParser.new(@adl_dir + 'openEHR-EHR-SECTION.summary.v1.adl') + @ap = OpenEHR::Parser::ADLParser.new(@adl_dir + 'openEHR-EHR-SECTION.summary.v1.adl') end it 'is an instance fo ADLParser' do - @ap.should be_an_instance_of ADLParser + @ap.should be_an_instance_of OpenEHR::Parser::ADLParser end context 'openEHR-EHR-SECTION.summary.v1 parse' do context 'ADL parser generates archetype from ADL' do before(:all) do @archetype = @ap.parse end it 'archetype is an instance of Archetype' do - @archetype.should be_an_instance_of Archetype + @archetype.should be_an_instance_of OpenEHR::AM::Archetype::Archetype end it 'archetype_id should be openEHR-EHR-SECTION-summary' do @archetype.archetype_id.value.should == 'openEHR-EHR-SECTION.summary.v1' @@ -140,11 +135,11 @@ before(:all) do @attribute = @definition.attributes[0] end it 'attribute is instance of CMultipleAttribute' do - @attribute.should be_an_instance_of CMultipleAttribute + @attribute.should be_an_instance_of OpenEHR::AM::Archetype::ConstraintModel::CMultipleAttribute end it 'rm_attribute_name is items' do @attribute.rm_attribute_name.should == 'items' end @@ -168,11 +163,11 @@ before(:all) do @archetype_slot = @attribute.children[0] end it 'is an instance of ArchetypeSlot' do - @archetype_slot.should be_an_instance_of ArchetypeSlot + @archetype_slot.should be_an_instance_of OpenEHR::AM::Archetype::ConstraintModel::ArchetypeSlot end it 's rm type name is EVALUATION' do @archetype_slot.rm_type_name.should == 'EVALUATION' end @@ -194,11 +189,11 @@ before(:all) do @assertion0 = @includes[0] end it 'assertion0 should be an instance of Assertion' do - @assertion0.should be_an_instance_of Assertion + @assertion0.should be_an_instance_of OpenEHR::AM::Archetype::Assertion::Assertion end it 'expression type of assertion0 is Boolean' do @assertion0.expression.type.should == 'Boolean' end @@ -212,11 +207,11 @@ before(:all) do @assertion1 = @includes[1] end it 'assertion1 is an instanse of Assertion' do - @assertion1.should be_an_instance_of Assertion + @assertion1.should be_an_instance_of OpenEHR::AM::Archetype::Assertion::Assertion end it 'Assertion1 type is Boolean' do @assertion1.expression.type.should == 'Boolean' end @@ -231,11 +226,11 @@ before(:all) do @assertion2 = @includes[2] end it 'assertion2 is an instanse of Assertion' do - @assertion2.should be_an_instance_of Assertion + @assertion2.should be_an_instance_of OpenEHR::AM::Archetype::Assertion::Assertion end it 'Assertion2 type is Boolean' do @assertion2.expression.type.should == 'Boolean' end @@ -250,11 +245,11 @@ before(:all) do @assertion3 = @includes[3] end it 'assertion3 is an instanse of Assertion' do - @assertion3.should be_an_instance_of Assertion + @assertion3.should be_an_instance_of OpenEHR::AM::Archetype::Assertion::Assertion end it 'Assertion3 type is Boolean' do @assertion3.expression.type.should == 'Boolean' end @@ -269,11 +264,11 @@ before(:all) do @assertion4 = @includes[4] end it 'assertion4 is an instanse of Assertion' do - @assertion4.should be_an_instance_of Assertion + @assertion4.should be_an_instance_of OpenEHR::AM::Archetype::Assertion::Assertion end it 'Assertion4 type is Boolean' do @assertion4.expression.type.should == 'Boolean' end @@ -288,11 +283,11 @@ before(:all) do @assertion5 = @includes[5] end it 'assertion5 is an instanse of Assertion' do - @assertion5.should be_an_instance_of Assertion + @assertion5.should be_an_instance_of OpenEHR::AM::Archetype::Assertion::Assertion end it 'Assertion5 type is Boolean' do @assertion5.expression.type.should == 'Boolean' end @@ -317,10 +312,10 @@ before(:all) do @archetype_ontology = @archetype.ontology end it 'is an ArchtypeOntology instance' do - @archetype_ontology.should be_an_instance_of ArchetypeOntology + @archetype_ontology.should be_an_instance_of OpenEHR::AM::Archetype::Ontology::ArchetypeOntology end it 'term_definitions parsed and assigned properly' do @archetype_ontology.term_definition(:lang => 'en', :code => 'at0000').items['text'].should == 'Summary'