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::Common::Generic include OpenEHR::RM::DataStructures::ItemStructure describe AdminEntry do it_should_behave_like 'entry' before(:each) do 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, :data => data) end it 'should be an instance of AdminEntry' do @admin_entry.should be_an_instance_of AdminEntry end it 'data should be assigned properly' do @admin_entry.data.archetype_node_id.should == 'at0002' end it 'should raise ArgumentError when nil assigned to data' do lambda { @admin_entry.data = nil }.should raise_error ArgumentError end end