source: ruby/trunk/spec/lib/open_ehr/rm/composition/content/entry/observation_spec.rb@ 369

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.3 KB
Line 
1require File.dirname(__FILE__) + '/../../../../../../spec_helper'
2require File.dirname(__FILE__) + '/shared_examples_spec'
3include OpenEHR::RM::DataStructures::History
4include OpenEHR::RM::Composition::Content::Entry
5
6describe Observation do
7 it_should_behave_like 'entry'
8
9 before(:each) do
10 data = stub(History, :archetype_node_id => 'at0002')
11 state = stub(History, :archetype_node_id => 'at0003')
12 @observation = Observation.new(:archetype_node_id => 'at0001',
13 :name => @name,
14 :language => @language,
15 :encoding => @encoding,
16 :subject => @subject,
17 :data => data,
18 :state => state)
19 end
20
21 it 'should be an instance of Observation' do
22 @observation.should be_an_instance_of Observation
23 end
24
25 it 'data should be assigned properly' do
26 @observation.data.archetype_node_id.should == 'at0002'
27 end
28
29 it 'should raise ArgumentError when nil assigned to data' do
30 lambda {
31 @observation.data = nil
32 }.should raise_error ArgumentError
33 end
34
35 it 'state should be assigned properly' do
36 @observation.state.archetype_node_id.should == 'at0003'
37 end
38end
Note: See TracBrowser for help on using the repository browser.