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
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
[407]16 adl_file.close
17 end
18
[406]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
[407]28 @adl_serializer.header.should == @sample_header
[406]29 end
[408]30
31 it 'description should return archetype description' do
32 @adl_serializer.description.should == @sample_description
33 end
[406]34end
Note: See TracBrowser for help on using the repository browser.