Sha256: 6375a3065ccf5d59a2c7fa9897638eda819ade6f145dcd81dee9e2eea5697426

Contents?: true

Size: 1011 Bytes

Versions: 1

Compression:

Stored size: 1011 Bytes

Contents

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

describe CSingleAttribute do
  before(:each) do
    existence = Interval.new(:upper =>0, :lower => 0) 
    alternatives = stub(Array, :size => 5)
    @c_single_attribute = CSingleAttribute.new(:path => '/event/at001',
                                              :rm_attribute_name => 'DV_DATE',
                                              :existence => existence,
                                              :alternatives => alternatives)
  end

  it 'should be an instance of CSingleAttribute' do
    @c_single_attribute.should be_an_instance_of CSingleAttribute
  end

  it 'alternative should be assigned properly' do
    @c_single_attribute.alternatives.size.should be_equal 5
  end

  it 'should raise ArgumentError when alternative is nil' do
    lambda {
      @c_single_attribute.alternatives = nil
    }.should raise_error ArgumentError
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
open_ehr-0.6.1 spec/lib/open_ehr/am/archetype/constraint_model/c_single_attribute_spec.rb