source: ruby/branches/0.5/spec/lib/open_ehr/rm/ehr/ehr_status_spec.rb@ 351

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

refs #44

File size: 1.5 KB
Line 
1require File.dirname(__FILE__) + '/../../../../spec_helper'
2include OpenEHR::RM::EHR
3include OpenEHR::RM::Common::Generic
4include OpenEHR::RM::DataTypes::Text
5include OpenEHR::RM::Support::Identification
6include OpenEHR::RM::DataStructures::ItemStructure
7
8describe EHRStatus do
9 before(:each) do
10 external_ref = stub(PartyRef, :namespace => 'ehr status')
11 subject = PartySelf.new(:external_ref => external_ref)
12 other_details = stub(ItemStructure, :archetype_node_id => 'at0005')
13 @ehr_status = EHRStatus.new(:archetype_node_id => 'at0001',
14 :name => DvText.new(:value => 'ehrstatus'),
15 :subject => subject,
16 :is_queryable => false,
17 :is_modifiable => true,
18 :other_details => other_details)
19 end
20
21 it 'should be an instance of EHRStatus' do
22 @ehr_status.should be_an_instance_of EHRStatus
23 end
24
25 it 'subject should be assigned properly' do
26 @ehr_status.subject.external_ref.namespace.should == 'ehr status'
27 end
28
29 it 'should raise ArgumentError with nil subject' do
30 lambda {
31 @ehr_status.subject = nil
32 }.should raise_error ArgumentError
33 end
34
35 it 'is_queryable should be properly assigned' do
36 @ehr_status.is_queryable?.should be_false
37 end
38
39 it 'is_modifiable should be assigned properly' do
40 @ehr_status.is_modifiable?.should be_true
41 end
42
43 it 'other_details should be assigned properly' do
44 @ehr_status.other_details.archetype_node_id.should == 'at0005'
45 end
46end
Note: See TracBrowser for help on using the repository browser.