Last change
on this file since 397 was 369, checked in by KOBAYASHI, Shinji, 15 years ago |
merge from branches/0.5
|
File size:
1.3 KB
|
Line | |
---|
1 | require File.dirname(__FILE__) + '/../../../../spec_helper'
|
---|
2 | include OpenEHR::RM::Demographic
|
---|
3 | include OpenEHR::RM::DataTypes::Text
|
---|
4 | include OpenEHR::RM::DataTypes::Quantity::DateTime
|
---|
5 | include OpenEHR::RM::Support::Identification
|
---|
6 | include OpenEHR::RM::DataStructures::ItemStructure
|
---|
7 |
|
---|
8 | describe Capability do
|
---|
9 | before(:each) do
|
---|
10 | name = DvText.new(:value => 'party relation')
|
---|
11 | credentials = stub(ItemStructure, :archetype_node_id => 'at0001')
|
---|
12 | lower = DvDate.new(:value => '2009-11-21')
|
---|
13 | time_validity = stub(DvInterval, :lower => lower)
|
---|
14 | @capability = Capability.new(:archetype_node_id => 'at0000',
|
---|
15 | :name => name,
|
---|
16 | :credentials => credentials,
|
---|
17 | :time_validity => time_validity)
|
---|
18 | end
|
---|
19 |
|
---|
20 | it 'should be an instance of Capability' do
|
---|
21 | @capability.should be_an_instance_of Capability
|
---|
22 | end
|
---|
23 |
|
---|
24 | it 'credential should be assigned properly' do
|
---|
25 | @capability.credentials.archetype_node_id.should == 'at0001'
|
---|
26 | end
|
---|
27 |
|
---|
28 | it 'should raise ArgumentError when nil assigned to credentials' do
|
---|
29 | lambda {
|
---|
30 | @capability.credentials = nil
|
---|
31 | }.should raise_error ArgumentError
|
---|
32 | end
|
---|
33 |
|
---|
34 | it 'time_validity should be assigned properly' do
|
---|
35 | @capability.time_validity.lower.value.should == '2009-11-21'
|
---|
36 | end
|
---|
37 | end
|
---|
Note:
See
TracBrowser
for help on using the repository browser.