Sha256: d4bb2b26b2fd6164a3cf64dafe672cbaa37372693e00171754b991f32a5fef8a

Contents?: true

Size: 927 Bytes

Versions: 26

Compression:

Stored size: 927 Bytes

Contents

require File.dirname(__FILE__) + '/../../../../../spec_helper'

include OpenEHR::RM::DataStructures::ItemStructure
include OpenEHR::RM::DataStructures::ItemStructure::Representation
include OpenEHR::RM::DataTypes::Text

describe ItemSingle do
  before(:each) do
    element = stub(Element, :archetype_node_id => 'at0002')
    item_single_name = DvText.new(:value => 'item single')
    @item_single = ItemSingle.new(:name => item_single_name,
                                  :archetype_node_id => 'at0001',
                                  :item => element)
  end

  it 'should be an instance of ItemSingle' do
    @item_single.should be_an_instance_of ItemSingle
  end

  it 'should raise ArgumentError with nil item' do
    lambda {
      @item_single.item = nil
    }.should raise_error ArgumentError
  end

  it 'should return as_hierarchy' do
    @item_single.as_hierarchy.archetype_node_id.should == 'at0002'
  end
end

Version data entries

26 entries across 26 versions & 2 rubygems

Version Path
openehr-1.2.8 spec/lib/openehr/rm/data_structures/item_structure/item_single_spec.rb
openehr-1.2.7 spec/lib/openehr/rm/data_structures/item_structure/item_single_spec.rb
openehr-1.2.6 spec/lib/openehr/rm/data_structures/item_structure/item_single_spec.rb
openehr-1.2.5 spec/lib/openehr/rm/data_structures/item_structure/item_single_spec.rb
openehr-1.2.4 spec/lib/openehr/rm/data_structures/item_structure/item_single_spec.rb
openehr-1.2.3 spec/lib/openehr/rm/data_structures/item_structure/item_single_spec.rb
openehr-1.2.2 spec/lib/openehr/rm/data_structures/item_structure/item_single_spec.rb
openehr-1.2.1 spec/lib/openehr/rm/data_structures/item_structure/item_single_spec.rb
openehr-1.2.0 spec/lib/openehr/rm/data_structures/item_structure/item_single_spec.rb
openehr-1.1.6 spec/lib/openehr/rm/data_structures/item_structure/item_single_spec.rb
openehr-1.1.5 spec/lib/openehr/rm/data_structures/item_structure/item_single_spec.rb
openehr-1.1.4 spec/lib/openehr/rm/data_structures/item_structure/item_single_spec.rb
openehr-1.1.3 spec/lib/openehr/rm/data_structures/item_structure/item_single_spec.rb
openehr-1.1.2 spec/lib/openehr/rm/data_structures/item_structure/item_single_spec.rb
openehr-1.1.1 spec/lib/openehr/rm/data_structures/item_structure/item_single_spec.rb
openehr-1.1.0 spec/lib/openehr/rm/data_structures/item_structure/item_single_spec.rb
open_ehr-1.0.2 spec/lib/open_ehr/rm/data_structures/item_structure/item_single_spec.rb
open_ehr-1.0.1 spec/lib/open_ehr/rm/data_structures/item_structure/item_single_spec.rb
open_ehr-1.0.0 spec/lib/open_ehr/rm/data_structures/item_structure/item_single_spec.rb
open_ehr-0.9.5 spec/lib/open_ehr/rm/data_structures/item_structure/item_single_spec.rb