source: ruby/trunk/spec/lib/open_ehr/am/archetype/assertion/expr_leaf_spec.rb@ 385

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

refs #73
Merry Xmass

File size: 910 bytes
Line 
1require File.dirname(__FILE__) + '/../../../../../spec_helper'
2include OpenEHR::AM::Archetype::Assertion
3
4describe ExprLeaf do
5 before(:each) do
6 @expr_leaf = ExprLeaf.new(:type => 'Boolean',
7 :item => 'ANY',
8 :reference_type => 'DV_TEXT')
9 end
10
11 it 'should be an instance of ExprLeaf' do
12 @expr_leaf.should be_an_instance_of ExprLeaf
13 end
14
15 it 'item should be assigned properly' do
16 @expr_leaf.item.should == 'ANY'
17 end
18
19 it 'should raise ArgumentError when item is nil' do
20 lambda {
21 @expr_leaf.item = nil
22 }.should raise_error ArgumentError
23 end
24
25 it 'reference_type should be assigned properly' do
26 @expr_leaf.reference_type.should == 'DV_TEXT'
27 end
28
29 it 'should raise ArgumentError when reference_type is nil' do
30 lambda {
31 @expr_leaf.reference_type = nil
32 }.should raise_error ArgumentError
33 end
34end
Note: See TracBrowser for help on using the repository browser.