Changeset 264 for ruby/branches/0.5/spec/lib/open_ehr
- Timestamp:
- Sep 14, 2009, 11:55:09 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
ruby/branches/0.5/spec/lib/open_ehr/rm/support/identification/archetype_id_spec.rb
r262 r264 42 42 @archetype_id.version_id.should == 'v2' 43 43 end 44 45 it 'should raise ArgumentError with wrong id format' do 46 lambda { 47 ArchetypeID.new(:value =>'wrong-format') 48 }.should raise_error ArgumentError 49 end 50 51 it 'should raise ArgumentError with nil concept name' do 52 lambda { 53 @archetype_id.concept_name = nil 54 }.should raise_error ArgumentError 55 end 56 57 it 'should raise ArgumentError with wrong domain concept format' do 58 lambda { 59 @archetype_id.domain_concept = '0123' 60 }.should raise_error ArgumentError 61 end 62 63 it 'should raise ArgumentError with empty rm_entity' do 64 lambda { 65 @archetype_id.rm_entity = '' 66 }.should raise_error ArgumentError 67 end 68 69 it 'should raise ArgumentError with nil rm_entity' do 70 lambda { 71 @archetype_id.rm_entity = nil 72 }.should raise_error ArgumentError 73 end 74 75 it 'should raise ArgumentError with empty rm_originator' do 76 lambda { 77 @archetype_id.rm_originator = '' 78 }.should raise_error ArgumentError 79 end 80 81 it 'should raise ArgumentError with nil rm_originator' do 82 lambda { 83 @archetype_id.rm_originator = nil 84 }.should raise_error ArgumentError 85 end 86 87 it 'should raise ArgumentError with empty specialisation' do 88 lambda { 89 @archetype_id.specialisation = '' 90 }.should raise_error ArgumentError 91 end 92 93 it 'should not raise ArgumentError with nil specialisation' do 94 lambda { 95 @archetype_id.specialisation = nil 96 }.should_not raise_error ArgumentError 97 end 98 99 describe 'another constructor' do 100 before(:each) do 101 @archetype_id = ArchetypeID.new(:rm_originator => 'openEHR', 102 :rm_name => 'EHR', 103 :rm_entity => 'EVALUATION', 104 :concept_name => 'clinical_synopsis', 105 :version_id => 'v1') 106 end 107 108 it 'should be an instance of ArchetypeID' do 109 @archetype_id.should be_an_instance_of ArchetypeID 110 end 111 112 it 'domain_concept should be clinical_synopsis' do 113 @archetype_id.domain_concept.should == 'clinical_synopsis' 114 end 115 end 116 117 describe 'domain concept' do 118 before(:each) do 119 @archetype_id.domain_concept = 'progress_note-naturopathy' 120 end 121 122 it 'concept_name should be progress note' do 123 @archetype_id.concept_name.should == 'progress_note' 124 end 125 126 it 'specialisation should be naturopathy' do 127 @archetype_id.specialisation === 'naturopathy' 128 end 129 130 it 'should raise ArgumentError empty domain concept' do 131 lambda { 132 @archetype_id.domain_concept = '' 133 }.should raise_error ArgumentError 134 end 135 136 it 'should raise ArgumentError nil domain concept' do 137 lambda { 138 @archetype_id.domain_concept = nil 139 }.should raise_error ArgumentError 140 end 141 142 it 's specialisation may be empty' do 143 @archetype_id.domain_concept = 'clinical_synopsis' 144 @archetype_id.concept_name.should == 'clinical_synopsis' 145 end 146 end 44 147 end
Note:
See TracChangeset
for help on using the changeset viewer.