source: ruby/branches/0.5/spec/lib/open_ehr/rm/data_structures/item_structure/representation/cluster_spec.rb@ 342

Last change on this file since 342 was 342, checked in by KOBAYASHI, Shinji, 14 years ago

ref #55, fixed #54

File size: 731 bytes
Line 
1require File.dirname(__FILE__) + '/../../../../../../spec_helper'
2include OpenEHR::RM::DataStructures::ItemStructure::Representation
3include OpenEHR::RM::DataTypes::Text
4
5describe Cluster do
6 before(:each) do
7 item = stub(Item)
8 @cluster = Cluster.new(:archetype_node_id => 'at0001',
9 :name => DvText.new(:value => 'cluster'),
10 :items => [item, item])
11 end
12
13 it 'should be an isntance of Cluster' do
14 @cluster.should be_an_instance_of Cluster
15 end
16
17 it 'item size should be 2' do
18 @cluster.items.size.should == 2
19 end
20
21 it 'should raise ArgumentError with empty items' do
22 lambda {
23 @cluster.items = []
24 }.should raise_error ArgumentError
25 end
26end
Note: See TracBrowser for help on using the repository browser.