Line | |
---|
1 | require File.dirname(__FILE__) + '/../../../../../spec_helper'
|
---|
2 | include OpenEHR::AM::Archetype::ConstraintModel
|
---|
3 | include OpenEHR::AssumedLibraryTypes
|
---|
4 |
|
---|
5 | describe 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
|
---|
35 | end
|
---|
36 |
|
---|
Note:
See
TracBrowser
for help on using the repository browser.