- Timestamp:
- Nov 6, 2009, 8:27:30 PM (14 years ago)
- Location:
- ruby/branches/0.5
- Files:
-
- 2 added
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
ruby/branches/0.5/lib/open_ehr/rm/common/generic.rb
r330 r334 184 184 class Attestation < AuditDetails 185 185 attr_reader :reason 186 attr_accessor :proof, : items186 attr_accessor :proof, :attested_view, :is_pending, :items 187 187 188 188 def initialize(args = { }) … … 191 191 self.proof = args[:proof] 192 192 self.items = args[:items] 193 self.attested_view = args[:attested_view] 194 self.is_pending = args[:is_pending] 193 195 end 194 196 … … 196 198 raise ArgumentError, 'reason is mandatory' if reason.nil? 197 199 @reason = reason 200 end 201 202 def items=(items) 203 if !items.nil? && items.empty? 204 raise ArgumentError, 'items should not be empty' 205 end 206 @items = items 207 end 208 209 def is_pending? 210 return is_pending 198 211 end 199 212 end -
ruby/branches/0.5/spec/lib/open_ehr/rm/common/generic/revision_history_spec.rb
r330 r334 31 31 @revision_history.most_recent_version_time_committed == '2009-11-02T22:19:34' 32 32 end 33 34 it 'should raise ArgumentError when item is nil' do 35 lambda { 36 @revision_history.items = nil 37 }.should raise_error ArgumentError 38 end 39 40 it 'should raise ArgumentError when item is empty' do 41 lambda { 42 @revision_history.items = Array.new 43 }.should raise_error ArgumentError 44 end 33 45 end
Note:
See TracChangeset
for help on using the changeset viewer.