Sha256: c4bbe1e7f7c899320382b11b20876f2e4f06a7e41efab8cce75d5a846bd7a428

Contents?: true

Size: 1.59 KB

Versions: 26

Compression:

Stored size: 1.59 KB

Contents

require File.dirname(__FILE__) + '/../../../../../../spec_helper'
include OpenEHR::RM::DataStructures::ItemStructure
include OpenEHR::RM::Composition::Content::Entry
include OpenEHR::RM::Support::Identification

describe InstructionDetails do
  before(:each) do
    instruction_id = stub(LocatableRef, :path => '[instruction]/[test]')
    wf_details = stub(ItemStructure, :archetype_node_id => 'at0004')
    @instruction_details =
      InstructionDetails.new(:instruction_id => instruction_id,
                             :activity_id => 'at0003',
                             :wf_details => wf_details)
  end

  it 'should be an instance of InstructionDetails' do
    @instruction_details.should be_an_instance_of InstructionDetails
  end

  it 'instruction_id should be assigned properly' do
    @instruction_details.instruction_id.path.should ==
      '[instruction]/[test]'
  end

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

  it 'activity_id should be assigned properly' do
    @instruction_details.activity_id.should == 'at0003'
  end

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

  it 'should raise ArgumentError with empty activity_id' do
    lambda {
      @instruction_details.activity_id = ''
    }.should raise_error ArgumentError
  end

  it 'wf_details should be assigned properly' do
    @instruction_details.wf_details.archetype_node_id.should == 
      'at0004'
  end
end

Version data entries

26 entries across 26 versions & 2 rubygems

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