source: ruby/trunk/spec/lib/open_ehr/rm/common/archetyped/archetyped_spec.rb@ 369

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

merge from branches/0.5

File size: 1.5 KB
Line 
1require File.dirname(__FILE__) + '/../../../../../spec_helper'
2include OpenEHR::RM::Common::Archetyped
3include OpenEHR::RM::Support::Identification
4
5describe Archetyped do
6 before(:each) do
7 archetype_id = ArchetypeID.new(:value =>
8 'openEHR-EHR-SECTION.physical_examination.v2')
9 template_id = TemplateID.new(:value =>
10 'uk.nhs.cfh:openehr-EHR-COMPOSITION.admission_ed.v5')
11 @archetyped = Archetyped.new(:archetype_id => archetype_id,
12 :rm_version => '1.2.4',
13 :template_id => template_id)
14 end
15
16 it 'should be an instance of Archetyped' do
17 @archetyped.should be_an_instance_of Archetyped
18 end
19
20 it 'archetype id concept rm_name should be EHR' do
21 @archetyped.archetype_id.rm_name.should == 'EHR'
22 end
23
24 it 'rm_version should 1.2.4' do
25 @archetyped.rm_version.should == '1.2.4'
26 end
27
28 it 'template_id.value should be uk.nhs.cfh:openehr-EHR-COMPOSITION.admission_ed.v5' do
29 @archetyped.template_id.value.should ==
30 'uk.nhs.cfh:openehr-EHR-COMPOSITION.admission_ed.v5'
31 end
32
33 it 'should raise ArgumentError with nil rm_version' do
34 lambda {
35 @archetyped.rm_version = nil
36 }.should raise_error ArgumentError
37 end
38
39 it 'should raise ArgumentError with empty rm_version' do
40 lambda {
41 @archetyped.rm_version = ''
42 }.should raise_error ArgumentError
43 end
44
45 it 'should raise ArgumentError with nil ArchetypeID' do
46 lambda {
47 @archetyped.archetype_id = nil
48 }.should raise_error ArgumentError
49 end
50end
Note: See TracBrowser for help on using the repository browser.