source: ruby/branches/0.5/spec/lib/open_ehr/rm/data_structures/item_structure/item_tree_spec.rb@ 215

Last change on this file since 215 was 215, checked in by KOBAYASHI, Shinji, 15 years ago

implemented ItemTree items. refs #54

File size: 797 bytes
Line 
1require File.dirname(__FILE__) + '/../../../../../spec_helper'
2
3include OpenEhr::RM::DataStructures::ItemStructure
4include OpenEhr::RM::DataStructures::ItemStructure::Representation
5include OpenEhr::RM::DataTypes::Text
6
7describe ItemTree do
8 before(:each) do
9 items = %w{one two}.collect do |name|
10 Element.new(:name => DvText.new(name),
11 :archetype_node_id => 'test')
12 end
13 name = DvText.new('item tree')
14 @item_tree = ItemTree.new(:name => name,
15 :archetype_node_id => 'test',
16 :items => items)
17 end
18
19 it 'should be an instance of ItemTree' do
20 @item_tree.should be_an_instance_of ItemTree
21 end
22
23 it 'fist item name should be one' do
24 @item_tree.items[0].name.value.should == 'one'
25 end
26end
Note: See TracBrowser for help on using the repository browser.