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

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

serialize attribute

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