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
openehr-1.2.7 spec/lib/openehr/rm/composition/content/navigation/section_spec.rb
openehr-1.2.6 spec/lib/openehr/rm/composition/content/navigation/section_spec.rb
openehr-1.2.5 spec/lib/openehr/rm/composition/content/navigation/section_spec.rb
openehr-1.2.4 spec/lib/openehr/rm/composition/content/navigation/section_spec.rb
openehr-1.2.3 spec/lib/openehr/rm/composition/content/navigation/section_spec.rb
openehr-1.2.2 spec/lib/openehr/rm/composition/content/navigation/section_spec.rb
openehr-1.2.1 spec/lib/openehr/rm/composition/content/navigation/section_spec.rb
openehr-1.2.0 spec/lib/openehr/rm/composition/content/navigation/section_spec.rb
openehr-1.1.6 spec/lib/openehr/rm/composition/content/navigation/section_spec.rb
openehr-1.1.5 spec/lib/openehr/rm/composition/content/navigation/section_spec.rb
openehr-1.1.4 spec/lib/openehr/rm/composition/content/navigation/section_spec.rb
openehr-1.1.3 spec/lib/openehr/rm/composition/content/navigation/section_spec.rb
openehr-1.1.2 spec/lib/openehr/rm/composition/content/navigation/section_spec.rb
openehr-1.1.1 spec/lib/openehr/rm/composition/content/navigation/section_spec.rb
openehr-1.1.0 spec/lib/openehr/rm/composition/content/navigation/section_spec.rb
open_ehr-1.0.2 spec/lib/open_ehr/rm/composition/content/navigation/section_spec.rb
open_ehr-1.0.1 spec/lib/open_ehr/rm/composition/content/navigation/section_spec.rb
open_ehr-1.0.0 spec/lib/open_ehr/rm/composition/content/navigation/section_spec.rb
open_ehr-0.9.5 spec/lib/open_ehr/rm/composition/content/navigation/section_spec.rb
open_ehr-0.9.4 spec/lib/open_ehr/rm/composition/content/navigation/section_spec.rb