Sha256: 31ce0230d9027b18e3ed41fcb14735112f9a4459b81cd020b3624dc56264ee7f

Contents?: true

Size: 1019 Bytes

Versions: 26

Compression:

Stored size: 1019 Bytes

Contents

require File.dirname(__FILE__) + '/../../../../spec_helper'
include OpenEHR::RM::Demographic
include OpenEHR::RM::DataTypes::Text
include OpenEHR::RM::DataStructures::ItemStructure

describe PartyIdentity do
  before(:each) do
    name = DvText.new(:value => 'test')
    details = stub(ItemStructure, :archetype_node_id => 'at0002')
    @party_identity = PartyIdentity.new(:archetype_node_id => 'at0001',
                                        :name => name,
                                        :details => details)
  end

  it 'should be an instance of PartyIdentity' do
    @party_identity.should be_an_instance_of PartyIdentity
  end

  it 'details should be assigned properly' do
    @party_identity.details.archetype_node_id.should == 'at0002'
  end

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

  it 'purpose should return as same as name' do
    @party_identity.purpose.value.should == 'test'
  end
end

Version data entries

26 entries across 26 versions & 2 rubygems

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