source: ruby/trunk/spec/lib/open_ehr/rm/ehr/versioned_composition_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.3 KB
Line 
1require File.dirname(__FILE__) + '/../../../../spec_helper'
2include OpenEHR::RM::EHR
3include OpenEHR::RM::Composition
4include OpenEHR::RM::Common::ChangeControl
5include OpenEHR::RM::DataTypes::Text
6include OpenEHR::RM::DataTypes::Quantity::DateTime
7
8describe VersionedComposition do
9 before(:each) do
10 composition1 = stub(Composition, :archetype_node_id => 'at0002',
11 :is_persistent? => true)
12 version1 = stub(Version, :data => composition1)
13 composition2 = stub(Composition, :archetype_node_id => 'at0002',
14 :is_persistent? => false)
15 version2 = stub(Version, :data => composition2)
16 uid = HierObjectID.new(:value => 'opeehr.jp::350')
17 owner_id = stub(ObjectRef, :type => 'EHR')
18 time_created = DvDateTime.new(:value => '2009-11-16T15:14:33')
19 @versioned_composition =
20 VersionedComposition.new(:uid => uid,
21 :owner_id => owner_id,
22 :time_created => time_created,
23 :all_versions => [version1, version2])
24 end
25
26 it 'should be an instance of VersionedComposition' do
27 @versioned_composition.should be_an_instance_of VersionedComposition
28 end
29
30 it 'is_persistent? should be evaluated by first version' do
31 @versioned_composition.is_persistent?.should be_true
32 end
33end
Note: See TracBrowser for help on using the repository browser.