Changeset 229


Ignore:
Timestamp:
Aug 27, 2009, 11:24:24 PM (11 years ago)
Author:
KOBAYASHI, Shinji
Message:

move from test to rspec

Location:
ruby/branches/0.5
Files:
1 added
2 edited

Legend:

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

    r226 r229  
    150150        class DvParagraph < OpenEHR::RM::DataTypes::Basic::DataValue
    151151          attr_reader :items
    152           def initialize(items)
    153             items_exists(items)
     152
     153          def initialize(args ={})
     154            self.items = args[:items]
     155          end
     156
     157          def items=(items)
     158            if items.nil? or items.empty?
     159              raise ArgumentError, "Items are not valid"
     160            end
    154161            @items = items
    155           end
    156           def items=(items)
    157             items_exists(items)
    158             @items = items
    159           end
    160           private
    161           def items_exists(items)
    162             if !items.nil? and !items.instance_of? Set
    163               raise ArgumentError, "Items are not valid"
    164             elsif !items.nil? and items.instance_of? Set
    165               raise ArgumentError, "Items must be exist" if items.empty?
    166             end
    167162          end
    168163        end
  • ruby/branches/0.5/spec/lib/open_ehr/rm/data_types/text/term_mapping_spec.rb

    r228 r229  
    11require File.dirname(__FILE__) + '/../../../../../spec_helper'
    22include OpenEHR::RM::DataTypes::Text
    3 include OpenEHR::RM::Support::Identification
    43
    54describe TermMapping do
Note: See TracChangeset for help on using the changeset viewer.