require File.dirname(__FILE__) + '/../../../../../spec_helper' require File.dirname(__FILE__) + '/shared_examples_spec' include OpenEHR::RM::Common::ChangeControl include OpenEHR::RM::DataTypes::Text describe OriginalVersion do it_should_behave_like 'change_control' it 'should be an isntance of OriginalVersion' do @original_version.should be_an_instance_of OriginalVersion end it 'attestation size should be 12' do @original_version.attestations.size.should == 12 end it 'other_version_input_uids size should be 5' do @original_version.other_input_version_uids.size.should == 5 end it 'is_merged? should be true when other_input_version_uids is nil' do @original_version.is_merged?.should be_true end it 'is_merged? should not be true when other_input_version_uids is not nil' do @original_version.other_input_version_uids = nil @original_version.is_merged?.should be_false end it 'should raise ArgumentError when attestations is nil' do lambda { @original_version.attestations = nil }.should raise_error ArgumentError end it 'should raise ArgumentError when other_input_version_uids is empty' do lambda { @original_version.other_input_version_uids = Set.new }.should raise_error ArgumentError end end