Sha256: d6bb49d78598b5eb89122a5c568e18215d7cea00877c18ac603263684be7fa51

Contents?: true

Size: 1.16 KB

Versions: 25

Compression:

Stored size: 1.16 KB

Contents

require File.dirname(__FILE__) + '/../../../../../../spec_helper'
include OpenEHR::AM::Archetype::ConstraintModel::Primitive
include OpenEHR::RM::DataTypes::Text

describe CPrimitive do
  before(:each) do
    default = DvText.new(:value => 'DEFAULT')
    assumed = DvText.new(:value => 'ASSUMED')
    @c_primitive = CPrimitive.new(:default_value => default,
                                  :assumed_value => assumed)
  end

  it 'should be an instance of CPrimitive' do
    @c_primitive.should be_an_instance_of CPrimitive
  end

  it 'type is ANY' do
    @c_primitive.type.should == 'ANY'
  end

  it 'default value should be assigned properly' do
    @c_primitive.default_value.value.should == 'DEFAULT'
  end

  it 'assumed_value should be assigned properly' do
    @c_primitive.assumed_value.value.should == 'ASSUMED'
  end

  it 'should be true when assumed_value is assigned' do
    @c_primitive.should have_assumed_value
  end

  it 'should not be true when assumed_value is not assigned' do
    @c_primitive.assumed_value = nil
    @c_primitive.should_not have_assumed_value
  end

  it 'type should not empty' do
    expect {@c_primitive.type = ''}.to raise_error
  end
end

Version data entries

25 entries across 25 versions & 2 rubygems

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