Changeset 194 for ruby


Ignore:
Timestamp:
Aug 13, 2009, 11:16:59 PM (15 years ago)
Author:
KOBAYASHI, Shinji
Message:

refs #54

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

Legend:

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

    r192 r194  
    3030
    3131        class ItemList < ItemStructure
     32          attr_accessor :items
     33
     34          def item_count
     35            unless @items.nil?
     36              return @items.size
     37            else
     38              return 0
     39            end
     40          end
    3241        end
    3342      end # of ItemStructure
  • ruby/branches/0.5/spec/lib/openehr/rm/data_structure/item_structure/item_list_spec.rb

    r193 r194  
    1010  end
    1111
    12   it 'should be valid' do
    13     @item_list.should_not be_nil
     12  it 'should be instance of ItemList' do
     13    @item_list.should be_an_instance_of ItemList
     14  end
     15
     16  it 'count should be 0' do
     17    @item_list.item_count.should equal 0
     18  end
     19
     20  it 'count should be change to 3' do
     21    dummy_elements = [1,2,3]
     22    @item_list.items = dummy_elements
     23    @item_list.item_count.should equal 3
    1424  end
    1525end
Note: See TracChangeset for help on using the changeset viewer.