Rev | Line | |
---|
[354] | 1 | require File.dirname(__FILE__) + '/../../../../../../spec_helper'
|
---|
[355] | 2 | require File.dirname(__FILE__) + '/shared_examples_spec'
|
---|
[354] | 3 | include OpenEHR::RM::Composition::Content::Entry
|
---|
| 4 | include OpenEHR::RM::DataTypes::Text
|
---|
| 5 | include OpenEHR::RM::Common::Generic
|
---|
| 6 | include OpenEHR::RM::DataStructures::ItemStructure
|
---|
| 7 |
|
---|
| 8 | describe AdminEntry do
|
---|
[355] | 9 | it_should_behave_like 'entry'
|
---|
| 10 |
|
---|
[354] | 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'),
|
---|
[355] | 15 | :language => @language,
|
---|
| 16 | :encoding => @encoding,
|
---|
| 17 | :subject => @subject,
|
---|
[354] | 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
|
---|
| 34 | end
|
---|
Note:
See
TracBrowser
for help on using the repository browser.