Last change
on this file since 351 was 279, checked in by KOBAYASHI, Shinji, 15 years ago |
support/identification package completely move to rspec
|
File size:
1.1 KB
|
Rev | Line | |
---|
[279] | 1 | require File.dirname(__FILE__) + '/../../../../../spec_helper'
|
---|
| 2 | include OpenEHR::RM::Support::Identification
|
---|
| 3 |
|
---|
| 4 | describe LocatableRef do
|
---|
| 5 | before(:each) do
|
---|
| 6 | object_version_id = ObjectVersionID.new(:value => 'deadbeef::babe::1')
|
---|
| 7 | @locatable_ref = LocatableRef.new(:id => object_version_id,
|
---|
| 8 | :namespace => 'local',
|
---|
| 9 | :type =>'PERSON',
|
---|
| 10 | :path => 'test/support')
|
---|
| 11 | end
|
---|
| 12 |
|
---|
| 13 | it 'should be an instance of LocatableRef' do
|
---|
| 14 | @locatable_ref.should be_an_instance_of LocatableRef
|
---|
| 15 | end
|
---|
| 16 |
|
---|
| 17 | it 'id should be deadbeef::babe::1' do
|
---|
| 18 | @locatable_ref.id.value.should == 'deadbeef::babe::1'
|
---|
| 19 | end
|
---|
| 20 |
|
---|
| 21 | it 'path should be test/support' do
|
---|
| 22 | @locatable_ref.path.should == 'test/support'
|
---|
| 23 | end
|
---|
| 24 |
|
---|
| 25 | it 'as_uri should be ehr://deadbeef::babe::1/test/support' do
|
---|
| 26 | @locatable_ref.as_uri.should == 'ehr://deadbeef::babe::1/test/support'
|
---|
| 27 | end
|
---|
| 28 |
|
---|
| 29 | it 'should raise ArgumentError with empty path' do
|
---|
| 30 | lambda {
|
---|
| 31 | @locatable_ref.path = ''
|
---|
| 32 | }.should raise_error ArgumentError
|
---|
| 33 | end
|
---|
| 34 | end
|
---|
Note:
See
TracBrowser
for help on using the repository browser.