Sha256: e2b3208dea3235a9d1efa3ff88da9db919010a242b60551ade88449d8a9cea38

Contents?: true

Size: 1.69 KB

Versions: 26

Compression:

Stored size: 1.69 KB

Contents

require File.dirname(__FILE__) + '/../../../../spec_helper'
include OpenEHR::RM::EHR
include OpenEHR::RM::Common::Generic
include OpenEHR::RM::DataTypes::Text
include OpenEHR::RM::Support::Identification
include OpenEHR::RM::DataStructures::ItemStructure

describe EHRStatus do
  before(:each) do
    external_ref = stub(PartyRef, :namespace => 'ehr status')
    subject = PartySelf.new(:external_ref => external_ref)
    other_details = stub(ItemStructure, :archetype_node_id => 'at0005')
    @ehr_status = EHRStatus.new(:archetype_node_id => 'at0001',
                                :name => DvText.new(:value => 'ehrstatus'),
                                :subject => subject,
                                :is_queryable => false,
                                :is_modifiable => true,
                                :other_details => other_details)
  end

  it 'should be an instance of EHRStatus' do
    @ehr_status.should be_an_instance_of EHRStatus
  end

  it 'subject should be assigned properly' do
    @ehr_status.subject.external_ref.namespace.should == 'ehr status'
  end

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

  it 'is_queryable should be properly assigned' do
    @ehr_status.is_queryable?.should be_false
  end

  it 'is_modifiable should be assigned properly' do
    @ehr_status.is_modifiable?.should be_true
  end

  it 'other_details should be assigned properly' do
    @ehr_status.other_details.archetype_node_id.should == 'at0005'
  end

  it 'should raise ArgumentError when parant is not nil' do
    lambda {
      @ehr_status.parent = 'parent'
    }.should raise_error ArgumentError
  end
end

Version data entries

26 entries across 26 versions & 2 rubygems

Version Path
open_ehr-0.9.4 spec/lib/open_ehr/rm/ehr/ehr_status_spec.rb
open_ehr-0.9.3 spec/lib/open_ehr/rm/ehr/ehr_status_spec.rb
open_ehr-0.9.2 spec/lib/open_ehr/rm/ehr/ehr_status_spec.rb
open_ehr-0.9.1 spec/lib/open_ehr/rm/ehr/ehr_status_spec.rb
open_ehr-0.9.0 spec/lib/open_ehr/rm/ehr/ehr_status_spec.rb
open_ehr-0.6.1 spec/lib/open_ehr/rm/ehr/ehr_status_spec.rb