Ignore:
Timestamp:
Nov 10, 2009, 9:46:35 PM (14 years ago)
Author:
KOBAYASHI, Shinji
Message:

data_structure will nearly completed

File:
1 edited

Legend:

Unmodified
Added
Removed
  • ruby/branches/0.5/spec/lib/open_ehr/rm/data_structures/item_structure/item_single_spec.rb

    r216 r339  
    66
    77describe ItemSingle do
    8   before(:all) do
    9     name =
    10     @element = Element.new(:name => DvText.new('item'),
    11                            :archetype_node_id => 'AT0000',
    12                            :value => DvQuantity.new())
    13     item_single_name = DvText.new('item single')
     8  before(:each) do
     9    element = stub(Element, :archetype_node_id => 'at0002')
     10    item_single_name = DvText.new(:value => 'item single')
    1411    @item_single = ItemSingle.new(:name => item_single_name,
    15                                   :archetype_node_id => 'test',
    16                                   :item => @element)
    17    
     12                                  :archetype_node_id => 'at0001',
     13                                  :item => element)
    1814  end
    1915
     16  it 'should be an instance of ItemSingle' do
     17    @item_single.should be_an_instance_of ItemSingle
     18  end
    2019
     20  it 'should raise ArgumentError with nil item' do
     21    lambda {
     22      @item_single.item = nil
     23    }.should raise_error ArgumentError
     24  end
     25
     26  it 'should return as_hierarchy' do
     27    @item_single.as_hierarchy.archetype_node_id.should == 'at0002'
     28  end
    2129end
Note: See TracChangeset for help on using the changeset viewer.