source: ruby/branches/0.5/spec/lib/open_ehr/rm/composition/content/navigation/section_spec.rb@ 347

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

fixed #56

File size: 900 bytes
Line 
1require File.dirname(__FILE__) + '/../../../../../../spec_helper'
2include OpenEHR::RM::Composition::Content::Navigation
3include OpenEHR::RM::DataTypes::Text
4
5describe Section do
6 before(:each) do
7 items = stub(Array, :empty? => false, :size => 10)
8 @section = Section.new(:archetype_node_id => 'at0001',
9 :name => DvText.new(:value => 'section'),
10 :items => items)
11 end
12
13 it 'should be an instance of Section' do
14 @section.should be_an_instance_of Section
15 end
16
17 it 'items should be assigned properly' do
18 @section.items.size.should be_equal 10
19 end
20
21 it 'empty items should raise ArgumentError' do
22 lambda {
23 @section.items = [ ]
24 }.should raise_error ArgumentError
25 end
26
27 it 'nil items should not raise ArgumentError' do
28 lambda {
29 @section.items = nil
30 }.should_not raise_error ArgumentError
31 end
32end
Note: See TracBrowser for help on using the repository browser.