source: ruby/trunk/spec/lib/open_ehr/am/archetype/constraint_model/c_primitive_object_spec.rb@ 380

Last change on this file since 380 was 380, checked in by KOBAYASHI, Shinji, 14 years ago

refs #74, #71

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