Line | |
---|
1 | require File.dirname(__FILE__) + '/../../../../../../spec_helper'
|
---|
2 | require File.dirname(__FILE__) + '/shared_examples_spec'
|
---|
3 | include OpenEHR::RM::DataStructures::History
|
---|
4 | include OpenEHR::RM::Composition::Content::Entry
|
---|
5 |
|
---|
6 | describe 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
|
---|
38 | end
|
---|
Note:
See
TracBrowser
for help on using the repository browser.