source: ruby/trunk/spec/lib/open_ehr/am/archetype/constraint_model/c_single_attribute_spec.rb@ 376

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

refs #72

File size: 1011 bytes
Line 
1require File.dirname(__FILE__) + '/../../../../../spec_helper'
2include OpenEHR::AM::Archetype::ConstraintModel
3include OpenEHR::AssumedLibraryTypes
4
5describe CSingleAttribute do
6 before(:each) do
7 existence = Interval.new(:upper =>0, :lower => 0)
8 alternatives = stub(Array, :size => 5)
9 @c_single_attribute = CSingleAttribute.new(:path => '/event/at001',
10 :rm_attribute_name => 'DV_DATE',
11 :existence => existence,
12 :alternatives => alternatives)
13 end
14
15 it 'should be an instance of CSingleAttribute' do
16 @c_single_attribute.should be_an_instance_of CSingleAttribute
17 end
18
19 it 'alternative should be assigned properly' do
20 @c_single_attribute.alternatives.size.should be_equal 5
21 end
22
23 it 'should raise ArgumentError when alternative is nil' do
24 lambda {
25 @c_single_attribute.alternatives = nil
26 }.should raise_error ArgumentError
27 end
28end
Note: See TracBrowser for help on using the repository browser.