Rev | Line | |
---|
[374] | 1 | require File.dirname(__FILE__) + '/../../../../../spec_helper'
|
---|
[375] | 2 | include OpenEHR::AM::Archetype::ConstraintModel
|
---|
[380] | 3 | include OpenEHR::AM::Archetype::Primitive
|
---|
[375] | 4 | include OpenEHR::AssumedLibraryTypes
|
---|
[374] | 5 |
|
---|
| 6 | describe CPrimitiveObject do
|
---|
| 7 | before(:each) do
|
---|
[375] | 8 | interval = Interval.new(:lower => 0, :upper => 1)
|
---|
[380] | 9 | item = stub(CPrimitive, :node_id => 'at0001')
|
---|
[375] | 10 | @c_primitive_object = CPrimitiveObject.new(:path => 'event/test',
|
---|
| 11 | :rm_type_name => 'DV_TEXT',
|
---|
| 12 | :node_id => 'ac0001',
|
---|
[380] | 13 | :occurrences => interval,
|
---|
| 14 | :item => item)
|
---|
[374] | 15 | end
|
---|
| 16 |
|
---|
| 17 | it 'should be an instance of CPrimitiveObject' do
|
---|
| 18 | @c_primitive_object.should be_an_instance_of CPrimitiveObject
|
---|
| 19 | end
|
---|
[380] | 20 |
|
---|
| 21 | it 'item should be assigned properly' do
|
---|
| 22 | @c_primitive_object.item.node_id.should == 'at0001'
|
---|
| 23 | end
|
---|
| 24 |
|
---|
| 25 | it 'should allowed any' do
|
---|
[381] | 26 | @c_primitive_object.should_not be_any_allowed
|
---|
[380] | 27 | end
|
---|
| 28 |
|
---|
| 29 | it 'should not any allowed' do
|
---|
| 30 | @c_primitive_object.item = nil
|
---|
[381] | 31 | @c_primitive_object.should be_any_allowed
|
---|
[380] | 32 | end
|
---|
[374] | 33 | end
|
---|
Note:
See
TracBrowser
for help on using the repository browser.