1 | require File.dirname(__FILE__) + '/../../../../../spec_helper'
|
---|
2 | include OpenEHR::RM::Common::Archetyped
|
---|
3 | include OpenEHR::RM::DataTypes::Text
|
---|
4 | include OpenEHR::RM::Support::Identification
|
---|
5 |
|
---|
6 | describe Locatable do
|
---|
7 | before(:each) do
|
---|
8 | name = DvText.new(:value => 'problem/SOAP')
|
---|
9 | link = stub(Set, :size => 10, :empty? => false)
|
---|
10 | uid = UIDBasedID.new(:value => 'ehr::localhost/3030')
|
---|
11 | archetype_details = stub(Archetyped, :rm_version => '1.2.4')
|
---|
12 | @locatable = Locatable.new(:archetype_node_id => 'at001',
|
---|
13 | :name => name,
|
---|
14 | :links => link,
|
---|
15 | :uid => uid,
|
---|
16 | :archetype_details => archetype_details)
|
---|
17 | end
|
---|
18 |
|
---|
19 | it 'should be_an_instance_of Locatable' do
|
---|
20 | @locatable.should be_an_instance_of Locatable
|
---|
21 | end
|
---|
22 |
|
---|
23 | it 'archetype_node_id should be at001' do
|
---|
24 | @locatable.archetype_node_id.should == 'at001'
|
---|
25 | end
|
---|
26 |
|
---|
27 | it 'link size should be 10' do
|
---|
28 | @locatable.links.size.should == 10
|
---|
29 | end
|
---|
30 |
|
---|
31 | it 'name.value should problem/soap' do
|
---|
32 | @locatable.name.value.should == 'problem/SOAP'
|
---|
33 | end
|
---|
34 |
|
---|
35 | it 'uid.value should be ehr::localhost/3030' do
|
---|
36 | @locatable.uid.value.should == 'ehr::localhost/3030'
|
---|
37 | end
|
---|
38 |
|
---|
39 | it 'archetype_details.rm_version should be 1.2.4' do
|
---|
40 | @locatable.archetype_details.rm_version.should == '1.2.4'
|
---|
41 | end
|
---|
42 |
|
---|
43 | it 'should raise ArgumentError with nil archetype_node_id' do
|
---|
44 | lambda {
|
---|
45 | @locatable.archetype_node_id = nil
|
---|
46 | }.should raise_error ArgumentError
|
---|
47 | end
|
---|
48 |
|
---|
49 | end
|
---|