Last change
on this file since 351 was 339, checked in by KOBAYASHI, Shinji, 15 years ago |
data_structure will nearly completed
|
File size:
927 bytes
|
Rev | Line | |
---|
[216] | 1 | require File.dirname(__FILE__) + '/../../../../../spec_helper'
|
---|
| 2 |
|
---|
| 3 | include OpenEHR::RM::DataStructures::ItemStructure
|
---|
| 4 | include OpenEHR::RM::DataStructures::ItemStructure::Representation
|
---|
| 5 | include OpenEHR::RM::DataTypes::Text
|
---|
| 6 |
|
---|
| 7 | describe ItemSingle do
|
---|
[339] | 8 | before(:each) do
|
---|
| 9 | element = stub(Element, :archetype_node_id => 'at0002')
|
---|
| 10 | item_single_name = DvText.new(:value => 'item single')
|
---|
[216] | 11 | @item_single = ItemSingle.new(:name => item_single_name,
|
---|
[339] | 12 | :archetype_node_id => 'at0001',
|
---|
| 13 | :item => element)
|
---|
[216] | 14 | end
|
---|
| 15 |
|
---|
[339] | 16 | it 'should be an instance of ItemSingle' do
|
---|
| 17 | @item_single.should be_an_instance_of ItemSingle
|
---|
| 18 | end
|
---|
[216] | 19 |
|
---|
[339] | 20 | it 'should raise ArgumentError with nil item' do
|
---|
| 21 | lambda {
|
---|
| 22 | @item_single.item = nil
|
---|
| 23 | }.should raise_error ArgumentError
|
---|
| 24 | end
|
---|
| 25 |
|
---|
| 26 | it 'should return as_hierarchy' do
|
---|
| 27 | @item_single.as_hierarchy.archetype_node_id.should == 'at0002'
|
---|
| 28 | end
|
---|
[216] | 29 | end
|
---|
Note:
See
TracBrowser
for help on using the repository browser.