Sha256: 14a816e8328b6d4f9230cba956d3b83a52ede70ea4dad8f3386bbda1cf8477af

Contents?: true

Size: 1.36 KB

Versions: 26

Compression:

Stored size: 1.36 KB

Contents

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

describe CComplexObject do
  before(:each) do
    occurrences = Interval.new(:lower => 0, :upper => 1)
    parent = stub(CAttribute, :rm_attribute_name => 'DV_DATE')
    attributes = stub(Set, :empty? => false, :size => 3)
    @c_complex_object = CComplexObject.new(:path => '/event/[at0001]/',
                                           :rm_type_name => 'DV_TIME',
                                           :node_id => 'ac0001',
                                           :occurrences => occurrences,
                                           :attributes => attributes)
  end

  it 'should be an instance of CComplexObject' do
    @c_complex_object.should be_an_instance_of CComplexObject
  end

  it 'attributes should be assigned properly' do
    @c_complex_object.attributes.size.should be_equal 3
  end

  it 'any_allowed should be false when attributes are not empty' do
    @c_complex_object.should_not be_any_allowed
  end


  it 'any_allowed should be true when attributes are nil' do
    @c_complex_object.attributes = nil
    @c_complex_object.should be_any_allowed
  end

  it 'any_allowed should be true when attributes are empty' do
    @c_complex_object.attributes = Set.new
    @c_complex_object.should be_any_allowed
  end
end

Version data entries

26 entries across 26 versions & 2 rubygems

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