Sha256: fbae19099feedeb7795517a522166145d4bf532911ec1a2557b85730101ddceb

Contents?: true

Size: 1.28 KB

Versions: 26

Compression:

Stored size: 1.28 KB

Contents

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

describe Capability do
  before(:each) do
    name = DvText.new(:value => 'party relation')
    credentials = stub(ItemStructure, :archetype_node_id => 'at0001')
    lower = DvDate.new(:value => '2009-11-21')
    time_validity = stub(DvInterval, :lower => lower)
    @capability = Capability.new(:archetype_node_id => 'at0000',
                                 :name => name,
                                 :credentials => credentials,
                                 :time_validity => time_validity)
  end

  it 'should be an instance of Capability' do
    @capability.should be_an_instance_of Capability
  end

  it 'credential should be assigned properly' do
    @capability.credentials.archetype_node_id.should == 'at0001'
  end

  it 'should raise ArgumentError when nil assigned to credentials' do
    lambda {
      @capability.credentials = nil
    }.should raise_error ArgumentError
  end

  it 'time_validity should be assigned properly' do
    @capability.time_validity.lower.value.should == '2009-11-21'
  end
end

Version data entries

26 entries across 26 versions & 2 rubygems

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