Last change
on this file since 369 was 369, checked in by KOBAYASHI, Shinji, 14 years ago |
merge from branches/0.5
|
File size:
1.1 KB
|
Rev | Line | |
---|
[305] | 1 | require File.dirname(__FILE__) + '/../../../../../spec_helper'
|
---|
| 2 | include OpenEHR::RM::Common::Archetyped
|
---|
| 3 | include OpenEHR::RM::DataTypes::Text
|
---|
| 4 | include OpenEHR::RM::DataTypes::Uri
|
---|
| 5 |
|
---|
| 6 | describe Link do
|
---|
| 7 | before(:each) do
|
---|
| 8 | @link = Link.new(:meaning => DvText.new(:value => 'generic'),
|
---|
| 9 | :type => DvText.new(:value => 'problem'),
|
---|
| 10 | :target => DvEhrUri.new(:value => 'ehr://test'))
|
---|
| 11 | end
|
---|
| 12 |
|
---|
| 13 | it 'should be an instance of Link' do
|
---|
| 14 | @link.should be_an_instance_of Link
|
---|
| 15 | end
|
---|
| 16 |
|
---|
| 17 | it 'meaning should be generic' do
|
---|
| 18 | @link.meaning.value.should == 'generic'
|
---|
| 19 | end
|
---|
| 20 |
|
---|
| 21 | it 'target should be ehr://test' do
|
---|
| 22 | @link.target.value.should == 'ehr://test'
|
---|
| 23 | end
|
---|
| 24 |
|
---|
| 25 | it 'should raise ArgumentError with nil meaning' do
|
---|
| 26 | lambda {
|
---|
| 27 | @link.meaning = nil
|
---|
| 28 | }.should raise_error ArgumentError
|
---|
| 29 | end
|
---|
| 30 |
|
---|
| 31 | it 'should raise ArgumentError with nil type' do
|
---|
| 32 | lambda {
|
---|
| 33 | @link.type = nil
|
---|
| 34 | }.should raise_error ArgumentError
|
---|
| 35 | end
|
---|
| 36 |
|
---|
| 37 | it 'should raise ArgumentError with nil target' do
|
---|
| 38 | lambda {
|
---|
| 39 | @link.target = nil
|
---|
| 40 | }.should raise_error ArgumentError
|
---|
| 41 | end
|
---|
| 42 |
|
---|
| 43 | end
|
---|
Note:
See
TracBrowser
for help on using the repository browser.