Last change
on this file since 308 was 273, checked in by KOBAYASHI, Shinji, 15 years ago |
uid_based_id family changed test/unit to rspec
|
File size:
1.2 KB
|
Rev | Line | |
---|
[273] | 1 | require File.dirname(__FILE__) + '/../../../../../spec_helper'
|
---|
| 2 | include OpenEHR::RM::Support::Identification
|
---|
| 3 |
|
---|
| 4 | describe UIDBasedID do
|
---|
| 5 | before(:each) do
|
---|
| 6 | @uid_based_id = UIDBasedID.new(:value => 'rrip::0.0.3')
|
---|
| 7 | end
|
---|
| 8 |
|
---|
| 9 | it 'should be an instance of UIDBasedID' do
|
---|
| 10 | @uid_based_id.should be_an_instance_of UIDBasedID
|
---|
| 11 | end
|
---|
| 12 |
|
---|
| 13 | it 'value should be rrip::0.0.3' do
|
---|
| 14 | @uid_based_id.value.should == 'rrip::0.0.3'
|
---|
| 15 | end
|
---|
| 16 |
|
---|
| 17 | it 'root should be rrip' do
|
---|
| 18 | @uid_based_id.root.value.should == 'rrip'
|
---|
| 19 | end
|
---|
| 20 |
|
---|
| 21 | it 'extention should be 0.0.3' do
|
---|
| 22 | @uid_based_id.extension.should == '0.0.3'
|
---|
| 23 | end
|
---|
| 24 |
|
---|
| 25 | it 'should have extension' do
|
---|
| 26 | @uid_based_id.has_extension?.should be_true
|
---|
| 27 | end
|
---|
| 28 |
|
---|
| 29 | describe 'when extension is empty' do
|
---|
| 30 | before(:each) do
|
---|
| 31 | @uid_based_id = UIDBasedID.new(:value => '10001')
|
---|
| 32 | end
|
---|
| 33 |
|
---|
| 34 | it 'value should be 10001' do
|
---|
| 35 | @uid_based_id.value.should == '10001'
|
---|
| 36 | end
|
---|
| 37 |
|
---|
| 38 | it 'has_extension? should not be true' do
|
---|
| 39 | @uid_based_id.has_extension?.should_not be_true
|
---|
| 40 | end
|
---|
| 41 |
|
---|
| 42 | it 's extention should be empty' do
|
---|
| 43 | @uid_based_id.extension.should == ''
|
---|
| 44 | end
|
---|
| 45 |
|
---|
| 46 | it 's root should be 10001' do
|
---|
| 47 | @uid_based_id.root.value.should == '10001'
|
---|
| 48 | end
|
---|
| 49 | end
|
---|
| 50 | end
|
---|
Note:
See
TracBrowser
for help on using the repository browser.