source: ruby/branches/0.5/spec/lib/open_ehr/rm/composition/content/entry/admin_entry_spec.rb@ 355

Last change on this file since 355 was 355, checked in by KOBAYASHI, Shinji, 14 years ago

refs #57 CareEntry

File size: 1.2 KB
Line 
1require File.dirname(__FILE__) + '/../../../../../../spec_helper'
2require File.dirname(__FILE__) + '/shared_examples_spec'
3include OpenEHR::RM::Composition::Content::Entry
4include OpenEHR::RM::DataTypes::Text
5include OpenEHR::RM::Common::Generic
6include OpenEHR::RM::DataStructures::ItemStructure
7
8describe AdminEntry do
9 it_should_behave_like 'entry'
10
11 before(:each) do
12 data = stub(ItemStructure, :archetype_node_id => 'at0002')
13 @admin_entry = AdminEntry.new(:archetype_node_id => 'at0001',
14 :name => DvText.new(:value => 'admin entry'),
15 :language => @language,
16 :encoding => @encoding,
17 :subject => @subject,
18 :data => data)
19 end
20
21 it 'should be an instance of AdminEntry' do
22 @admin_entry.should be_an_instance_of AdminEntry
23 end
24
25 it 'data should be assigned properly' do
26 @admin_entry.data.archetype_node_id.should == 'at0002'
27 end
28
29 it 'should raise ArgumentError when nil assigned to data' do
30 lambda {
31 @admin_entry.data = nil
32 }.should raise_error ArgumentError
33 end
34end
Note: See TracBrowser for help on using the repository browser.