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

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

serializer implementation

File size: 988 bytes
Line 
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
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
15 @sample_description = adl[9..22].join
16 adl_file.close
17 end
18
19 before(:each) do
20 @adl_serializer = ADLSerializer.new(@archetype)
21 end
22
23 it 'should be an instance of ADLSerializer' do
24 @adl_serializer.should be_an_instance_of ADLSerializer
25 end
26
27 it 'header should return archetype context' do
28 @adl_serializer.header.should == @sample_header
29 end
30
31 it 'description should return archetype description' do
32 @adl_serializer.description.should == @sample_description
33 end
34end
Note: See TracBrowser for help on using the repository browser.