Rev | Line | |
---|
[360] | 1 | require File.dirname(__FILE__) + '/../../../../spec_helper'
|
---|
| 2 | include OpenEHR::RM::Integration
|
---|
| 3 | include OpenEHR::RM::DataStructures::ItemStructure
|
---|
| 4 | include OpenEHR::RM::DataTypes::Text
|
---|
| 5 |
|
---|
| 6 | describe GenericEntry do
|
---|
| 7 | before(:each) do
|
---|
| 8 | data = stub(ItemTree, :archetype_node_id => 'at0003')
|
---|
| 9 | name = DvText.new(:value => 'generic entry')
|
---|
| 10 | @generic_entry = GenericEntry.new(:archetype_node_id => 'at0001',
|
---|
| 11 | :name => name,
|
---|
| 12 | :data => data)
|
---|
| 13 | end
|
---|
| 14 |
|
---|
| 15 | it 'should be an instance of GenericEntry' do
|
---|
| 16 | @generic_entry.should be_an_instance_of GenericEntry
|
---|
| 17 | end
|
---|
| 18 |
|
---|
| 19 | it 'data should be assigned properly' do
|
---|
| 20 | @generic_entry.data.archetype_node_id.should == 'at0003'
|
---|
| 21 | end
|
---|
| 22 |
|
---|
| 23 | it 'should raise ArgumentError when data are nil' do
|
---|
| 24 | lambda {
|
---|
| 25 | @generic_entry.data = nil
|
---|
| 26 | }.should raise_error ArgumentError
|
---|
| 27 | end
|
---|
| 28 | end
|
---|
| 29 |
|
---|
| 30 |
|
---|
| 31 |
|
---|
Note:
See
TracBrowser
for help on using the repository browser.