Index: /ruby/branches/0.5/lib/open_ehr/rm/common/generic.rb
===================================================================
--- /ruby/branches/0.5/lib/open_ehr/rm/common/generic.rb	(revision 311)
+++ /ruby/branches/0.5/lib/open_ehr/rm/common/generic.rb	(revision 312)
@@ -34,9 +34,9 @@
           def time_committed=(time_committed)
             if time_committed.nil?
-              raise ArgumentError, 'time_commited is mandatory'
+              raise ArgumentError, 'time_committed is mandatory'
             end
             @time_committed = time_committed
           end
-
+             
           def change_type=(change_type)
             raise ArgumentError, 'change_type is mandatory' if change_type.nil?
@@ -103,4 +103,5 @@
         class PartyIdentified < PartyProxy
           attr_reader :name, :identifier
+
           def initialize(args = { })
             if args[:external_ref].nil? && args[:name].nil? &&
Index: /ruby/branches/0.5/spec/lib/open_ehr/rm/common/generic/audit_details_spec.rb
===================================================================
--- /ruby/branches/0.5/spec/lib/open_ehr/rm/common/generic/audit_details_spec.rb	(revision 312)
+++ /ruby/branches/0.5/spec/lib/open_ehr/rm/common/generic/audit_details_spec.rb	(revision 312)
@@ -0,0 +1,39 @@
+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
+
+describe AuditDetails 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')
+    desc = DvText.new(:value => 'test environment')
+    @audit_details = AuditDetails.new(:system_id => 'MAGI',
+                                      :committer => committer,
+                                      :time_committed => time,
+                                      :change_type => change_type,
+                                      :description => desc)
+  end
+
+  it 'should be an instance of AuditDetails' do
+    @audit_details.should be_an_instance_of AuditDetails
+  end
+
+  it 'system_id should be MAGI' do
+    @audit_details.system_id.should == 'MAGI'
+  end
+
+  it 'committer namespece should be UNKNOWN' do
+    @audit_details.committer.namespace.should == 'UNKNOWN'
+  end
+
+  it 'change_type.value should be creation' do
+    @audit_details.change_type.value.should == 'creation'
+  end
+
+  it 'description should be test environment' do
+    @audit_details.description.value.should == 'test environment'
+  end
+end
Index: /ruby/branches/0.5/spec/lib/open_ehr/rm/common/generic/participation_spec.rb
===================================================================
--- /ruby/branches/0.5/spec/lib/open_ehr/rm/common/generic/participation_spec.rb	(revision 312)
+++ /ruby/branches/0.5/spec/lib/open_ehr/rm/common/generic/participation_spec.rb	(revision 312)
@@ -0,0 +1,36 @@
+require File.dirname(__FILE__) + '/../../../../../spec_helper'
+include OpenEHR::RM::Common::Generic
+
+describe Participation do
+  before(:each) do
+    performer = stub(PartyProxy, :name => 'GEHIRN')
+    function = stub(DvText, :value => 'committer')
+    mode = stub(DvCodedText, :value => 'present')
+    lower = stub(DvDateTime, :value => '2009-10-03T20:33:05')
+    time = stub(DvInterval, :lower => lower)
+    @participation = Participation.new(:performer => performer,
+                                       :function => function,
+                                       :mode => mode,
+                                       :time => time)
+  end
+
+  it 'should be an instance of Participation' do
+    @participation.should be_an_instance_of Participation
+  end
+
+  it 'should assign performer properly' do
+    @participation.performer.name.should == 'GEHIRN'
+  end
+
+  it 'should assign function properly' do
+    @participation.function.value.should == 'committer'
+  end
+
+  it 'should assign mode properly' do
+    @participation.mode.value.should == 'present'
+  end
+
+  it 'should assign time properly' do
+    @participation.time.lower.value.should == '2009-10-03T20:33:05'
+  end
+end
Index: /ruby/branches/0.5/spec/lib/open_ehr/rm/common/generic/party_identified_spec.rb
===================================================================
--- /ruby/branches/0.5/spec/lib/open_ehr/rm/common/generic/party_identified_spec.rb	(revision 312)
+++ /ruby/branches/0.5/spec/lib/open_ehr/rm/common/generic/party_identified_spec.rb	(revision 312)
@@ -0,0 +1,28 @@
+require File.dirname(__FILE__) + '/../../../../../spec_helper'
+include OpenEHR::RM::Common::Generic
+
+describe PartyIdentified do
+  before(:each) do
+    external_ref = stub(PartyRef, :namespace => 'unknown')
+    identifiers = stub(Array, :size => 5, :empty? => false)
+    @party_identified = PartyIdentified.new(:name => 'NERV',
+                                            :external_ref => external_ref,
+                                            :identifier => identifiers)
+  end
+
+  it 'should be an instance of PartyIdentified' do
+    @party_identified.should be_an_instance_of PartyIdentified
+  end
+
+  it 'should assign name properly' do
+    @party_identified.name.should == 'NERV'
+  end
+
+  it 'should assign external_ref properly' do
+    @party_identified.external_ref.namespace.should == 'unknown'
+  end
+
+  it 'should assign identifier properly' do
+    @party_identified.identifier.size.should be_equal 5
+  end
+end
Index: /ruby/branches/0.5/spec/lib/open_ehr/rm/common/generic/party_proxy_spec.rb
===================================================================
--- /ruby/branches/0.5/spec/lib/open_ehr/rm/common/generic/party_proxy_spec.rb	(revision 312)
+++ /ruby/branches/0.5/spec/lib/open_ehr/rm/common/generic/party_proxy_spec.rb	(revision 312)
@@ -0,0 +1,18 @@
+require File.dirname(__FILE__) + '/../../../../../spec_helper'
+include OpenEHR::RM::Common::Generic
+include OpenEHR::RM::Support::Identification
+
+describe PartyProxy do
+  before(:each) do
+    external_ref = stub(PartyRef, :namespace => 'NERV')
+    @party_proxy = PartyProxy.new(:external_ref => external_ref)
+  end
+
+  it 'should be an isntance of PartyProxy' do
+    @party_proxy.should be_an_instance_of PartyProxy
+  end
+
+  it 'exnternal_ref.namespace should be NERV' do
+    @party_proxy.external_ref.namespace.should == 'NERV'
+  end
+end
Index: /ruby/branches/0.5/spec/lib/open_ehr/rm/common/generic/party_related_spec.rb
===================================================================
--- /ruby/branches/0.5/spec/lib/open_ehr/rm/common/generic/party_related_spec.rb	(revision 312)
+++ /ruby/branches/0.5/spec/lib/open_ehr/rm/common/generic/party_related_spec.rb	(revision 312)
@@ -0,0 +1,24 @@
+require File.dirname(__FILE__) + '/../../../../../spec_helper'
+include OpenEHR::RM::Common::Generic
+
+describe PartyRelated do
+  before(:each) do
+    relationship = stub(DvCodedText, :value => 'self')
+    @party_related = PartyRelated.new(:name => 'TEST',
+                                      :relationship => relationship)
+  end
+
+  it 'should be an instance of PartyRelated' do
+    @party_related.should be_an_instance_of PartyRelated
+  end
+
+  it 'should assign relationship properly' do
+    @party_related.relationship.value.should == 'self'
+  end
+
+  it 'should raise ArgumentError when nil is assigned to relationship' do
+    lambda {
+      @party_related.relationship = nil
+    }.should raise_error ArgumentError
+  end
+end
Index: /ruby/branches/0.5/spec/lib/open_ehr/rm/common/generic/revision_history_item_spec.rb
===================================================================
--- /ruby/branches/0.5/spec/lib/open_ehr/rm/common/generic/revision_history_item_spec.rb	(revision 312)
+++ /ruby/branches/0.5/spec/lib/open_ehr/rm/common/generic/revision_history_item_spec.rb	(revision 312)
@@ -0,0 +1,43 @@
+require File.dirname(__FILE__) + '/../../../../../spec_helper'
+include OpenEHR::RM::Common::Generic
+include OpenEHR::RM::Support::Identification
+
+describe RevisionHistoryItem do
+  before(:each)do
+    version_id = stub(ObjectVersionID, :object_id => 'RIO')
+    audits = stub(Array, :size => 30, :empty? => false)
+    @revision_history_item =
+      RevisionHistoryItem.new(:version_id => version_id,
+                              :audits => audits)
+  end
+
+  it 'should be an instance of RevisionHistoryItem' do
+    @revision_history_item.should be_an_instance_of RevisionHistoryItem
+  end
+
+  it 's version_id.object_id should be RIO' do
+    @revision_history_item.version_id.object_id.should == 'RIO'
+  end
+
+  it 's audits.size should be 30' do
+    @revision_history_item.audits.size.should be_equal 30
+  end
+
+  it 'should raise ArgumentError when nil is assigned to version id' do
+    lambda {
+      @revision_history_item.version_id = nil
+    }.should raise_error ArgumentError
+  end
+
+  it 'should raise ArgumentError when nil is assinged to audits' do
+    lambda {
+      @revision_history_item.audits = nil
+    }.should raise_error ArgumentError
+  end
+
+  it 'should raise ArgumentError when empty is assinged to audits' do
+    lambda {
+      @revision_history_item.audits = Array.new
+    }.should raise_error ArgumentError
+  end
+end
