Changeset 334


Ignore:
Timestamp:
Nov 6, 2009, 8:27:30 PM (14 years ago)
Author:
KOBAYASHI, Shinji
Message:

Versioning system is complexed

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  
    184184        class Attestation < AuditDetails
    185185          attr_reader :reason
    186           attr_accessor :proof, :items
     186          attr_accessor :proof, :attested_view, :is_pending, :items
    187187
    188188          def initialize(args = { })
     
    191191            self.proof = args[:proof]
    192192            self.items = args[:items]
     193            self.attested_view = args[:attested_view]
     194            self.is_pending = args[:is_pending]
    193195          end
    194196
     
    196198            raise ArgumentError, 'reason is mandatory' if reason.nil?
    197199            @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
    198211          end
    199212        end
  • ruby/branches/0.5/spec/lib/open_ehr/rm/common/generic/revision_history_spec.rb

    r330 r334  
    3131    @revision_history.most_recent_version_time_committed == '2009-11-02T22:19:34'
    3232  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
    3345end
Note: See TracChangeset for help on using the changeset viewer.