source: ruby/trunk/spec/lib/open_ehr/am/archetype/validity_kind_spec.rb@ 396

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

refs #71, #71

File size: 1.1 KB
Line 
1require File.dirname(__FILE__) + '/../../../../spec_helper'
2include OpenEHR::AM::Archetype
3
4describe ValidityKind do
5 before(:each) do
6 @validity_kind = ValidityKind.new(:value => 1002)
7 end
8
9 it 'should be an instance of ValidityKind' do
10 @validity_kind.should be_an_instance_of ValidityKind
11 end
12
13 it 'mandatory should be equal 1001' do
14 ValidityKind::MANDATORY.should be_equal 1001
15 end
16
17 it 'optional should be equal 1002' do
18 ValidityKind::OPTIONAL.should be_equal 1002
19 end
20
21 it 'disallowed should be equal 1003' do
22 ValidityKind::DISALLOWED.should be_equal 1003
23 end
24
25 it 'should not raise ArgumentError with valid value' do
26 lambda {
27 [1001, 1002, 1003].each {|value| @validity_kind.value = value}
28 }.should_not raise_error ArgumentError
29 end
30
31 it 'should raise ArgumentError with invalid value such as 1000' do
32 lambda {
33 @validity_kind.value = 1000
34 }.should raise_error ArgumentError
35 end
36
37 it 'should raise ArgumentError with invalid value such as 1004' do
38 lambda {
39 @validity_kind.value = 1004
40 }.should raise_error ArgumentError
41 end
42end
Note: See TracBrowser for help on using the repository browser.