Last change
on this file since 388 was 369, checked in by KOBAYASHI, Shinji, 15 years ago |
merge from branches/0.5
|
File size:
926 bytes
|
Rev | Line | |
---|
[362] | 1 | require File.dirname(__FILE__) + '/../../../../spec_helper'
|
---|
| 2 | include OpenEHR::RM::Demographic
|
---|
| 3 | include OpenEHR::RM::DataTypes::Text
|
---|
| 4 | include OpenEHR::RM::DataStructures::ItemStructure
|
---|
| 5 |
|
---|
| 6 | describe Address do
|
---|
| 7 | before(:each) do
|
---|
| 8 | name = DvText.new(:value => 'address')
|
---|
| 9 | details = stub(ItemStructure, :archetype_node_id => 'at0001')
|
---|
| 10 | @address = Address.new(:archetype_node_id => 'at0000',
|
---|
| 11 | :name => name,
|
---|
| 12 | :details => details)
|
---|
| 13 | end
|
---|
| 14 |
|
---|
| 15 | it 'should be an instance of Address' do
|
---|
| 16 | @address.should be_an_instance_of Address
|
---|
| 17 | end
|
---|
| 18 |
|
---|
| 19 | it 'type is inherit from name' do
|
---|
| 20 | @address.type.value.should == 'address'
|
---|
| 21 | end
|
---|
| 22 |
|
---|
| 23 | it 'details should be assigned properly' do
|
---|
| 24 | @address.details.archetype_node_id.should == 'at0001'
|
---|
| 25 | end
|
---|
| 26 |
|
---|
| 27 | it 'should raise ArgumentError with nil details' do
|
---|
| 28 | lambda {
|
---|
| 29 | @address.details = nil
|
---|
| 30 | }.should raise_error ArgumentError
|
---|
| 31 | end
|
---|
| 32 | end
|
---|
| 33 |
|
---|
Note:
See
TracBrowser
for help on using the repository browser.