Changeset 336 for ruby/branches


Ignore:
Timestamp:
Nov 10, 2009, 12:59:33 AM (14 years ago)
Author:
KOBAYASHI, Shinji
Message:

change_control completed

File:
1 edited

Legend:

Unmodified
Added
Removed
  • ruby/branches/0.5/spec/lib/open_ehr/rm/common/change_control/versioned_object_spec.rb

    r335 r336  
    185185    attestations = stub(Array, :empty? => false)
    186186    @versioned_object.
    187       commit_original_version(:contribution => contribution,
     187      commit_original_merged_version(:contribution => contribution,
    188188                              :uid => uid,
    189189                              :preceding_version_uid => preceding_version_uid,
     
    228228      should == 'CDAEbad'
    229229  end
     230
     231  it 'should raise ArgumentError when time_created is nil' do
     232    lambda {
     233      @versioned_object.time_created = nil
     234    }.should raise_error ArgumentError
     235  end
     236
     237  it 'should raise ArgumentError when all_versions are nil' do
     238    lambda {
     239      @versioned_object.all_versions = nil
     240    }.should raise_error ArgumentError
     241  end
     242
     243  it 'should raise ArgumentError when is_original_version argument is nil' do
     244    lambda {
     245      @versioned_object.is_original_version?(nil)
     246    }.should raise_error ArgumentError
     247  end
     248
     249  it 'should not has time data' do
     250    unexisted_time = DvDateTime.new(:value => '2009-11-10T00:43:59')
     251    lambda {
     252      @versioned_object.version_at_time(unexisted_time)
     253    }.should raise_error ArgumentError
     254  end
     255
     256  it 'should raise ArgumentError with nil argument to commit_attestations' do
     257    lambda {
     258      @versioned_object.commit_attestation(:attestation => nil)
     259    }.should raise_error ArgumentError
     260  end
     261
     262  it 'should raise ArgumentError with not orinigal version id' do
     263    uid = ObjectVersionID.new(:value => 'ABC::DEF::1')
     264    attestation = stub(Attestation)
     265    lambda {
     266      @versioned_object.commit_attestation(:attestation => attestation,
     267                                           :uid => uid,
     268                                           :signature => 'DEADBEAFE81')
     269    }.should raise_error ArgumentError
     270  end
     271
     272  it 'should raise ArgumentError with nil argument to version with id' do
     273    lambda {
     274      @versioned_object.version_with_id(nil)
     275    }.should raise_error ArgumentError
     276  end
     277
     278  it 'should raise ArgumentError with unexsited version with id ' do
     279    uid = ObjectVersionID.new(:value => 'CBA::FED::1')
     280    lambda {
     281      @versioned_object.version_with_id(uid)
     282    }.should raise_error ArgumentError
     283  end
    230284end
    231 
    232 
Note: See TracChangeset for help on using the changeset viewer.