source: ruby/trunk/spec/lib/open_ehr/am/archetype/assertion/expr_unary_operator_spec.rb@ 389

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

refs #73
A happy new year!

File size: 861 bytes
Line 
1require File.dirname(__FILE__) + '/../../../../../spec_helper'
2include OpenEHR::AM::Archetype::Assertion
3
4describe ExprUnaryOperator do
5 before(:each) do
6 operator = OperatorKind.new(:value => 2001)
7 operand = stub(ExprItem, :type => 'Real')
8 @expr_unary_operator =
9 ExprUnaryOperator.new(:type => 'Integer',
10 :item => 'ANY',
11 :reference_type => 'operator',
12 :operator => operator,
13 :precedence_overridden => true,
14 :operand => operand)
15 end
16
17 it 'operand shoud be assigned properly' do
18 @expr_unary_operator.operand.type.should == 'Real'
19 end
20
21 it 'should raise ArgumentError when operand is nil' do
22 lambda {
23 @expr_unary_operator.operand = nil
24 }.should raise_error ArgumentError
25 end
26end
Note: See TracBrowser for help on using the repository browser.