Index: ruby/branches/0.5/spec/lib/open_ehr/rm/common/change_control/contribution_spec.rb
===================================================================
--- ruby/branches/0.5/spec/lib/open_ehr/rm/common/change_control/contribution_spec.rb	(revision 334)
+++ ruby/branches/0.5/spec/lib/open_ehr/rm/common/change_control/contribution_spec.rb	(revision 334)
@@ -0,0 +1,56 @@
+require File.dirname(__FILE__) + '/../../../../../spec_helper'
+include OpenEHR::RM::Common::ChangeControl
+include OpenEHR::RM::DataTypes::Text
+
+describe Contribution do
+  before(:each) do
+    uid = HierObjectID.new(:value => 'ABC::DEF::2')
+    versions = stub(Set, :size => 2, :empty? => false)
+    description = DvText.new(:value => 'test')
+    audit = stub(AuditDetails, :empty? => false, :description => description)
+    @contribution = Contribution.new(:uid => uid,
+                                     :versions => versions,
+                                     :audit => audit)
+  end
+
+  it 'should be an instance of Contribution' do
+    @contribution.should be_an_instance_of Contribution
+  end
+
+  it 'uid.value should be ABC::DEF::2' do
+    @contribution.uid.value.should == 'ABC::DEF::2'
+  end
+
+  it 'audit.description should test' do
+    @contribution.audit.description.value.should == 'test'
+  end
+
+  it 'versions size should be 2' do
+    @contribution.versions.size.should == 2
+  end
+
+  it 'should raise ArgumentError when version is empty' do
+    lambda {
+      @contribution.versions = Set.new
+    }.should raise_error ArgumentError
+  end
+
+  it 'should raise ArgumentError when uid is nil' do
+    lambda {
+      @contribution.uid = nil
+    }.should raise_error ArgumentError
+  end
+
+  it 'should raise ArgumentError audit is nil' do
+    lambda {
+      @contribution.audit = nil
+    }.should raise_error ArgumentError
+  end
+
+  it 'shoudl raise ArgumentError audit.description is empty' do
+    nil_audit = stub(AuditDetails, :description => nil)
+    lambda {
+      @contribution.audit = nil_audit
+    }.should raise_error ArgumentError
+  end 
+end
Index: ruby/branches/0.5/spec/lib/open_ehr/rm/common/generic/attestation_spec.rb
===================================================================
--- ruby/branches/0.5/spec/lib/open_ehr/rm/common/generic/attestation_spec.rb	(revision 334)
+++ ruby/branches/0.5/spec/lib/open_ehr/rm/common/generic/attestation_spec.rb	(revision 334)
@@ -0,0 +1,62 @@
+require File.dirname(__FILE__) + '/../../../../../spec_helper'
+include OpenEHR::RM::Common::Generic
+include OpenEHR::RM::Support::Identification
+include OpenEHR::RM::DataTypes::Text
+include OpenEHR::RM::DataTypes::Quantity::DateTime
+include OpenEHR::RM::DataTypes::Encapsulated
+
+describe Attestation do
+  before(:each) do
+    committer = stub(PartyProxy, :namespace => 'UNKNOWN')
+    change_type = stub(DvCodedText, :value =>'creation')
+    time = stub(DvDateTime, :value => '2009-10-03T16:24:19.0Z')
+    reason = DvText.new(:value => 'signed')
+    items = stub(Set, :empty? => false, :size => 3)
+    attested_view = stub(DvMultimedia, :size => 300)
+    @attestation = Attestation.new(:committer => committer,
+                                   :change_type => change_type,
+                                   :time_committed => time,
+                                   :system_id => 'test',
+                                   :reason => reason,
+                                   :proof => 'DEADBEEFBABE',
+                                   :is_pending => true,
+                                   :attested_view => attested_view,
+                                   :items => items)
+  end
+
+  it 'should be an instance of Attestation' do
+    @attestation.should be_an_instance_of Attestation
+  end
+
+  it 'reason should be signed' do
+    @attestation.reason.value.should == 'signed'
+  end
+
+  it 'proof should DEADBEEFBABE' do
+    @attestation.proof.should == 'DEADBEEFBABE'
+  end
+
+  it 'attested view size should be 300' do
+    @attestation.attested_view.size.should == 300
+  end
+
+  it 'is_pending? should true' do
+    @attestation.is_pending?.should be_true
+  end
+
+  it 'items size should be 30' do
+    @attestation.items.size.should == 3
+  end
+
+  it 'should raise ArgumentError when items are empty' do
+    lambda {
+      @attestation.items = Set.new
+    }.should raise_error ArgumentError
+  end
+
+  it 'should not raise ArgumentErro when items are nil' do
+    lambda {
+      @attestation.items = nil
+    }.should_not raise_error ArgumentError
+  end
+end
Index: ruby/branches/0.5/spec/lib/open_ehr/rm/common/generic/revision_history_spec.rb
===================================================================
--- ruby/branches/0.5/spec/lib/open_ehr/rm/common/generic/revision_history_spec.rb	(revision 333)
+++ ruby/branches/0.5/spec/lib/open_ehr/rm/common/generic/revision_history_spec.rb	(revision 334)
@@ -31,3 +31,15 @@
     @revision_history.most_recent_version_time_committed == '2009-11-02T22:19:34'
   end
+
+  it 'should raise ArgumentError when item is nil' do
+    lambda {
+      @revision_history.items = nil
+    }.should raise_error ArgumentError
+  end
+
+  it 'should raise ArgumentError when item is empty' do
+    lambda {
+      @revision_history.items = Array.new
+    }.should raise_error ArgumentError
+  end
 end
