Index: ruby/branches/0.5/spec/lib/open_ehr/rm/composition/content/entry/admin_entry_spec.rb
===================================================================
--- ruby/branches/0.5/spec/lib/open_ehr/rm/composition/content/entry/admin_entry_spec.rb	(revision 354)
+++ ruby/branches/0.5/spec/lib/open_ehr/rm/composition/content/entry/admin_entry_spec.rb	(revision 355)
@@ -1,3 +1,4 @@
 require File.dirname(__FILE__) + '/../../../../../../spec_helper'
+require File.dirname(__FILE__) + '/shared_examples_spec'
 include OpenEHR::RM::Composition::Content::Entry
 include OpenEHR::RM::DataTypes::Text
@@ -6,14 +7,13 @@
 
 describe AdminEntry do
+  it_should_behave_like 'entry'
+
   before(:each) do
-    language = stub(CodePhrase)
-    encoding = stub(CodePhrase)
-    subject = stub(PartyProxy)
     data = stub(ItemStructure, :archetype_node_id => 'at0002')
     @admin_entry = AdminEntry.new(:archetype_node_id => 'at0001',
                                   :name => DvText.new(:value => 'admin entry'),
-                                  :language => language,
-                                  :encoding => encoding,
-                                  :subject => subject,
+                                  :language => @language,
+                                  :encoding => @encoding,
+                                  :subject => @subject,
                                   :data => data)
   end
Index: ruby/branches/0.5/spec/lib/open_ehr/rm/composition/content/entry/care_entry_spec.rb
===================================================================
--- ruby/branches/0.5/spec/lib/open_ehr/rm/composition/content/entry/care_entry_spec.rb	(revision 355)
+++ ruby/branches/0.5/spec/lib/open_ehr/rm/composition/content/entry/care_entry_spec.rb	(revision 355)
@@ -0,0 +1,35 @@
+require File.dirname(__FILE__) + '/../../../../../../spec_helper'
+require File.dirname(__FILE__) + '/shared_examples_spec'
+include OpenEHR::RM::Composition::Content::Entry
+include OpenEHR::RM::DataTypes::Text
+include OpenEHR::RM::DataStructures::ItemStructure
+include OpenEHR::RM::Support::Identification
+
+describe CareEntry do
+  it_should_behave_like 'entry'
+
+  before(:each) do
+    protocol = stub(ItemStructure, :archetype_node_id => 'at0003')
+    guideline_id = stub(ObjectRef, :type => 'care guideline')
+    @care_entry = CareEntry.new(:archetype_node_id => 'at0001',
+                                :name => DvText.new(:value => 'care entry'),
+                                :language => @language,
+                                :encoding => @encoding,
+                                :subject => @subject,
+                                :protocol => protocol,
+                                :guideline_id => guideline_id)
+  end
+
+  it 'should be an instance of CareEntry' do
+    @care_entry.should be_an_instance_of CareEntry
+  end
+
+  it 'protocol should be assigned properly' do
+    @care_entry.protocol.archetype_node_id.should == 'at0003'
+  end
+
+  it 'guideline should be assined properly' do
+    @care_entry.guideline_id.type.should == 'care guideline'
+  end
+end
+
Index: ruby/branches/0.5/spec/lib/open_ehr/rm/composition/content/entry/entry_spec.rb
===================================================================
--- ruby/branches/0.5/spec/lib/open_ehr/rm/composition/content/entry/entry_spec.rb	(revision 354)
+++ ruby/branches/0.5/spec/lib/open_ehr/rm/composition/content/entry/entry_spec.rb	(revision 355)
@@ -1,3 +1,4 @@
 require File.dirname(__FILE__) + '/../../../../../../spec_helper'
+require File.dirname(__FILE__) + '/shared_examples_spec'
 include OpenEHR::RM::Composition::Content::Entry
 include OpenEHR::RM::DataTypes::Text
@@ -5,7 +6,7 @@
 
 describe Entry do
+  it_should_behave_like 'entry'
+
   before(:each) do
-    language = stub(CodePhrase, :code_string => 'ja')
-    encoding = stub(CodePhrase, :code_string => 'UTF-8')
     external_ref = stub(PartyRef, :type => 'entry')
     subject = PartyProxy.new(:external_ref => external_ref)
@@ -16,6 +17,6 @@
     @entry = Entry.new(:archetype_node_id => 'at0001',
                        :name => DvText.new(:value => 'entry test'),
-                       :language => language,
-                       :encoding => encoding,
+                       :language => @language,
+                       :encoding => @encoding,
                        :subject => subject,
                        :provider => provider,
Index: ruby/branches/0.5/spec/lib/open_ehr/rm/composition/content/entry/shared_examples_spec.rb
===================================================================
--- ruby/branches/0.5/spec/lib/open_ehr/rm/composition/content/entry/shared_examples_spec.rb	(revision 355)
+++ ruby/branches/0.5/spec/lib/open_ehr/rm/composition/content/entry/shared_examples_spec.rb	(revision 355)
@@ -0,0 +1,11 @@
+require File.dirname(__FILE__) + '/../../../../../../spec_helper'
+include OpenEHR::RM::DataTypes::Text
+include OpenEHR::RM::Common::Generic
+
+shared_examples_for 'entry', :shared => true do
+  before(:each) do
+    @language = stub(CodePhrase, :code_string => 'ja')
+    @encoding = stub(CodePhrase, :code_string => 'UTF-8')
+    @subject = stub(PartyProxy)
+  end
+end
