Changeset 238


Ignore:
Timestamp:
Aug 28, 2009, 1:45:46 AM (10 years ago)
Author:
KOBAYASHI, Shinji
Message:

dv_parsable modified

Location:
ruby/branches/0.5
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • ruby/branches/0.5/lib/open_ehr/rm/data_types/encapsulated.rb

    r237 r238  
    8080
    8181        class DvParsable < DvEncapsulated
    82           attr_reader :value, :formalism
     82          attr_reader :formalism
    8383
    8484          def initialize(args = {})
     
    8888
    8989          def formalism=(formalism)
    90             if formalism.nil?
    91               raise ArgumentError, "formalism must not be nil"
    92             elsif formalism.empty?
    93               raise ArgumentError, "formalism must nto be empty"
     90            if formalism.nil? || formalism.empty?
     91              raise ArgumentError, 'formalism is mandatory'
    9492            end
    9593            @formalism = formalism
  • ruby/branches/0.5/spec/lib/open_ehr/rm/data_types/encapsulated/dv_parsable_spec.rb

    r237 r238  
    2020    @dv_parsable.formalism.should == 'plain/text'
    2121  end
     22
     23  it 'should raise ArgumentError formalism nil' do
     24    lambda {@dv_parsable.formalism = nil}.should raise_error(ArgumentError)
     25  end
    2226end
Note: See TracChangeset for help on using the changeset viewer.