Sha256: ca9c082aea1f0fbd6ff8e32ef9d113cfd0cf744a0c91b227c550403a7895ba33

Contents?: true

Size: 900 Bytes

Versions: 25

Compression:

Stored size: 900 Bytes

Contents

require File.dirname(__FILE__) + '/../../../../../../spec_helper'
include OpenEHR::RM::Composition::Content::Navigation
include OpenEHR::RM::DataTypes::Text

describe Section do
  before(:each) do
    items = stub(Array, :empty? => false, :size => 10)
    @section = Section.new(:archetype_node_id => 'at0001',
                           :name => DvText.new(:value => 'section'),
                           :items => items)
  end

  it 'should be an instance of Section' do
    @section.should be_an_instance_of Section
  end

  it 'items should be assigned properly' do
    @section.items.size.should be_equal 10
  end

  it 'empty items should raise ArgumentError' do
    lambda {
      @section.items = [ ]
    }.should raise_error ArgumentError
  end

  it 'nil items should not raise ArgumentError' do
    lambda {
      @section.items = nil
    }.should_not raise_error ArgumentError
  end
end

Version data entries

25 entries across 25 versions & 2 rubygems

Version Path
open_ehr-0.9.3 spec/lib/open_ehr/rm/composition/content/navigation/section_spec.rb
open_ehr-0.9.2 spec/lib/open_ehr/rm/composition/content/navigation/section_spec.rb
open_ehr-0.9.1 spec/lib/open_ehr/rm/composition/content/navigation/section_spec.rb
open_ehr-0.9.0 spec/lib/open_ehr/rm/composition/content/navigation/section_spec.rb
open_ehr-0.6.1 spec/lib/open_ehr/rm/composition/content/navigation/section_spec.rb