Sha256: 530e77125397368444e7d7044d0835515c3ee105dc364e6b7f390c6744f30db1

Contents?: true

Size: 1.23 KB

Versions: 16

Compression:

Stored size: 1.23 KB

Contents

# ticket 192
require File.dirname(__FILE__) + '/../../../../../../spec_helper'
require 'openehr/am/openehr_profile/data_types/basic'
include ::OpenEHR::AM::OpenEHRProfile::DataTypes::Basic
include ::OpenEHR::AssumedLibraryTypes
require 'set'

describe CDvState do
  before(:each) do
    proposed_state = State.new(:name => 'PROPOSED')
    complete_state = TerminalState.new(:name => 'COMPLETED')
    finish = Transition.new(:event => 'finish', :next_state => complete_state)
    transitions = Set[finish]
    non_terminal_state = NonTerminalState.new(:name => 'IN_EXECUTION',
                                              :transitions => transitions)
    states = Set[proposed_state, non_terminal_state, complete_state]
    state_machine = StateMachine.new(:states => states)
    occurrences = Interval.new(:upper => 1, :lower => 1)
    @c_dv_state = CDvState.new(:value => state_machine, :path => '/',
                               :occurrences => occurrences)
  end

  it 'is an instance of StateMachine' do
    @c_dv_state.should be_an_instance_of CDvState
  end

  it 'states size should be 3' do
    @c_dv_state.value.states.size.should be 3
  end

  it 'raise error if value is nil' do
    expect {@c_dv_state.value = nil}.to raise_error
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
openehr-1.2.8 spec/lib/openehr/am/openehr_profile/data_types/basic/c_dv_state_spec.rb
openehr-1.2.7 spec/lib/openehr/am/openehr_profile/data_types/basic/c_dv_state_spec.rb
openehr-1.2.6 spec/lib/openehr/am/openehr_profile/data_types/basic/c_dv_state_spec.rb
openehr-1.2.5 spec/lib/openehr/am/openehr_profile/data_types/basic/c_dv_state_spec.rb
openehr-1.2.4 spec/lib/openehr/am/openehr_profile/data_types/basic/c_dv_state_spec.rb
openehr-1.2.3 spec/lib/openehr/am/openehr_profile/data_types/basic/c_dv_state_spec.rb
openehr-1.2.2 spec/lib/openehr/am/openehr_profile/data_types/basic/c_dv_state_spec.rb
openehr-1.2.1 spec/lib/openehr/am/openehr_profile/data_types/basic/c_dv_state_spec.rb
openehr-1.2.0 spec/lib/openehr/am/openehr_profile/data_types/basic/c_dv_state_spec.rb
openehr-1.1.6 spec/lib/openehr/am/openehr_profile/data_types/basic/c_dv_state_spec.rb
openehr-1.1.5 spec/lib/openehr/am/openehr_profile/data_types/basic/c_dv_state_spec.rb
openehr-1.1.4 spec/lib/openehr/am/openehr_profile/data_types/basic/c_dv_state_spec.rb
openehr-1.1.3 spec/lib/openehr/am/openehr_profile/data_types/basic/c_dv_state_spec.rb
openehr-1.1.2 spec/lib/openehr/am/openehr_profile/data_types/basic/c_dv_state_spec.rb
openehr-1.1.1 spec/lib/openehr/am/openehr_profile/data_types/basic/c_dv_state_spec.rb
openehr-1.1.0 spec/lib/openehr/am/openehr_profile/data_types/basic/c_dv_state_spec.rb