source: ruby/trunk/spec/lib/open_ehr/serializer/adl_serializer_spec.rb@ 411

Last change on this file since 411 was 411, checked in by KOBAYASHI, Shinji, 14 years ago

fixed archetype ontology bugs

File size: 1.3 KB
RevLine 
[406]1require File.dirname(__FILE__) + '/../../../spec_helper'
2require File.dirname(__FILE__) + '/sample_archetype_spec'
3include OpenEHR::Serializer
4include OpenEHR::AM::Archetype
5include OpenEHR::RM::Support::Identification
6
7describe ADLSerializer do
8 it_should_behave_like 'sample archetype'
9
[407]10 before(:all) do
11 current_dir = File.dirname(__FILE__)
12 adl_file = File.open(current_dir + '/openEHR-EHR-SECTION.test.v1.adl')
13 adl = adl_file.readlines
14 @sample_header = adl[0..7].join
[408]15 @sample_description = adl[9..22].join
[409]16 @sample_definition = adl[24..25].join
[411]17 @sample_ontology = adl[27..37].join
[407]18 adl_file.close
19 end
20
[406]21 before(:each) do
22 @adl_serializer = ADLSerializer.new(@archetype)
23 end
24
25 it 'should be an instance of ADLSerializer' do
26 @adl_serializer.should be_an_instance_of ADLSerializer
27 end
28
29 it 'header should return archetype context' do
[407]30 @adl_serializer.header.should == @sample_header
[406]31 end
[408]32
33 it 'description should return archetype description' do
34 @adl_serializer.description.should == @sample_description
35 end
[409]36
37 it 'definition should return ADL formatted definition' do
38 @adl_serializer.definition.should == @sample_definition
39 end
[411]40
41 it 'ontology should return ADL formatted ontology' do
42 @adl_serializer.ontology.should == @sample_definition
43 end
[406]44end
Note: See TracBrowser for help on using the repository browser.