source: ruby/trunk/spec/lib/open_ehr/am/archetype/constraint_model/archetype_internal_ref_spec.rb@ 382

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

refs #74
implemented release 1.0.2

File size: 1.2 KB
Line 
1require File.dirname(__FILE__) + '/../../../../../spec_helper'
2include OpenEHR::AM::Archetype::ConstraintModel
3include OpenEHR::AssumedLibraryTypes
4
5describe ArchetypeInternalRef do
6 before(:each) do
7 occurrences = Interval.new(:lower => 0, :upper => 1)
8 @archetype_internal_ref =
9 ArchetypeInternalRef.new(:path => '/event/[at0001]/',
10 :rm_type_name => 'DV_TIME',
11 :node_id => 'ac0001',
12 :occurrences => occurrences,
13 :target_path => '/data/[at0002]')
14 end
15
16 it 'should be an instance of ArchetypeInternalRef' do
17 @archetype_internal_ref.should be_an_instance_of ArchetypeInternalRef
18 end
19
20 it 'target_path should be assigned properly' do
21 @archetype_internal_ref.target_path.should == '/data/[at0002]'
22 end
23
24 it 'should raise ArgumentError when target_path is nil.' do
25 lambda {
26 @archetype_internal_ref.target_path = nil
27 }.should raise_error ArgumentError
28 end
29
30 it 'should raise ArgumentError when target_path is empty.' do
31 lambda {
32 @archetype_internal_ref.target_path = ''
33 }.should raise_error ArgumentError
34 end
35end
36
Note: See TracBrowser for help on using the repository browser.