Sha256: d42f783f9a95733784017baf45ce732c2ad7f51dfd856065c57c02f646cb345d

Contents?: true

Size: 910 Bytes

Versions: 26

Compression:

Stored size: 910 Bytes

Contents

require File.dirname(__FILE__) + '/../../../../../spec_helper'
include OpenEHR::AM::Archetype::ConstraintModel
include OpenEHR::AssumedLibraryTypes

describe ConstraintRef do
  before(:each) do
    occurrences = Interval.new(:lower => 0, :upper => 1)
    @constraint_ref =
      ConstraintRef.new(:path => '/event/[at0001]/',
                        :rm_type_name => 'DV_TIME',
                        :node_id => 'ac0001',
                        :occurrences => occurrences,
                        :reference => 'ac0002')
  end

  it 'should be an instance of ConstraintRef' do
    @constraint_ref.should be_an_instance_of ConstraintRef
  end

  it 'reference should be assigned properly' do
    @constraint_ref.reference.should == 'ac0002'
  end

  it 'should raise ArgumentError when reference is nil' do
    lambda {
      @constraint_ref.reference = nil
    }.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/am/archetype/constraint_model/constraint_ref_spec.rb
open_ehr-0.9.3 spec/lib/open_ehr/am/archetype/constraint_model/constraint_ref_spec.rb
open_ehr-0.9.2 spec/lib/open_ehr/am/archetype/constraint_model/constraint_ref_spec.rb
open_ehr-0.9.1 spec/lib/open_ehr/am/archetype/constraint_model/constraint_ref_spec.rb
open_ehr-0.9.0 spec/lib/open_ehr/am/archetype/constraint_model/constraint_ref_spec.rb
open_ehr-0.6.1 spec/lib/open_ehr/am/archetype/constraint_model/constraint_ref_spec.rb