Last change
on this file since 388 was 369, checked in by KOBAYASHI, Shinji, 15 years ago |
merge from branches/0.5
|
File size:
927 bytes
|
Line | |
---|
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
|
---|
8 | before(:each) do
|
---|
9 | element = stub(Element, :archetype_node_id => 'at0002')
|
---|
10 | item_single_name = DvText.new(:value => 'item single')
|
---|
11 | @item_single = ItemSingle.new(:name => item_single_name,
|
---|
12 | :archetype_node_id => 'at0001',
|
---|
13 | :item => element)
|
---|
14 | end
|
---|
15 |
|
---|
16 | it 'should be an instance of ItemSingle' do
|
---|
17 | @item_single.should be_an_instance_of ItemSingle
|
---|
18 | end
|
---|
19 |
|
---|
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
|
---|
29 | end
|
---|
Note:
See
TracBrowser
for help on using the repository browser.