source: ruby/branches/0.5/spec/lib/open_ehr/rm/composition/content/entry/ism_transition_spec.rb@ 359

Last change on this file since 359 was 359, checked in by KOBAYASHI, Shinji, 14 years ago

fixed #57

File size: 1.5 KB
Line 
1require File.dirname(__FILE__) + '/../../../../../../spec_helper'
2include OpenEHR::RM::Composition::Content::Entry
3include OpenEHR::RM::DataTypes::Text
4
5describe IsmTransition do
6 before(:each) do
7 current_state = stub(DvCodedText, :value => 'planned')
8 transition = stub(DvCodedText, :value => 'scheduled')
9 careflow_step = stub(DvCodedText, :value => 'completed')
10 @ism_transition = IsmTransition.new(:current_state => current_state,
11 :transition => transition,
12 :careflow_step => careflow_step)
13 end
14
15 it 'should be an instance of IsmTransition' do
16 @ism_transition.should be_an_instance_of IsmTransition
17 end
18
19 it 'current_status should be assigned properly' do
20 @ism_transition.current_state.value.should == 'planned'
21 end
22
23 it 'should raise ArgumentError with nil current state' do
24 lambda {
25 @ism_transition.current_state = nil
26 }.should raise_error ArgumentError
27 end
28
29 it 'should raise ArgumentError when current_state has invalid code'
30
31 it 'transition should be assined properly' do
32 @ism_transition.transition.value.should == 'scheduled'
33 end
34
35 it 'should raise ArgumentError with nil transition' do
36 lambda {
37 @ism_transition.transition = nil
38 }.should raise_error ArgumentError
39 end
40
41 it 'should raise ArugmentError with invalid transition code'
42
43 it 'careflow_step should be assigned properly' do
44 @ism_transition.careflow_step.value.should == 'completed'
45 end
46end
Note: See TracBrowser for help on using the repository browser.