Rev | Line | |
---|
[347] | 1 | require File.dirname(__FILE__) + '/../../../../../../spec_helper'
|
---|
| 2 | include OpenEHR::RM::Composition::Content::Navigation
|
---|
| 3 | include OpenEHR::RM::DataTypes::Text
|
---|
| 4 |
|
---|
| 5 | describe 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
|
---|
| 32 | end
|
---|
Note:
See
TracBrowser
for help on using the repository browser.