[312] | 1 | require File.dirname(__FILE__) + '/../../../../../spec_helper'
|
---|
| 2 | include OpenEHR::RM::Common::Generic
|
---|
| 3 | include OpenEHR::RM::Support::Identification
|
---|
| 4 |
|
---|
| 5 | describe RevisionHistoryItem do
|
---|
| 6 | before(:each)do
|
---|
| 7 | version_id = stub(ObjectVersionID, :object_id => 'RIO')
|
---|
| 8 | audits = stub(Array, :size => 30, :empty? => false)
|
---|
| 9 | @revision_history_item =
|
---|
| 10 | RevisionHistoryItem.new(:version_id => version_id,
|
---|
| 11 | :audits => audits)
|
---|
| 12 | end
|
---|
| 13 |
|
---|
| 14 | it 'should be an instance of RevisionHistoryItem' do
|
---|
| 15 | @revision_history_item.should be_an_instance_of RevisionHistoryItem
|
---|
| 16 | end
|
---|
| 17 |
|
---|
| 18 | it 's version_id.object_id should be RIO' do
|
---|
| 19 | @revision_history_item.version_id.object_id.should == 'RIO'
|
---|
| 20 | end
|
---|
| 21 |
|
---|
| 22 | it 's audits.size should be 30' do
|
---|
| 23 | @revision_history_item.audits.size.should be_equal 30
|
---|
| 24 | end
|
---|
| 25 |
|
---|
| 26 | it 'should raise ArgumentError when nil is assigned to version id' do
|
---|
| 27 | lambda {
|
---|
| 28 | @revision_history_item.version_id = nil
|
---|
| 29 | }.should raise_error ArgumentError
|
---|
| 30 | end
|
---|
| 31 |
|
---|
| 32 | it 'should raise ArgumentError when nil is assinged to audits' do
|
---|
| 33 | lambda {
|
---|
| 34 | @revision_history_item.audits = nil
|
---|
| 35 | }.should raise_error ArgumentError
|
---|
| 36 | end
|
---|
| 37 |
|
---|
| 38 | it 'should raise ArgumentError when empty is assinged to audits' do
|
---|
| 39 | lambda {
|
---|
| 40 | @revision_history_item.audits = Array.new
|
---|
| 41 | }.should raise_error ArgumentError
|
---|
| 42 | end
|
---|
| 43 | end
|
---|